Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

News Update My table error ! #15

Closed
ghost opened this issue Mar 28, 2015 · 3 comments
Closed

News Update My table error ! #15

ghost opened this issue Mar 28, 2015 · 3 comments

Comments

@ghost
Copy link

ghost commented Mar 28, 2015

My Error :
ErrorException in Datatables.php line 329:
Undefined offset: 4

My Controller :

$data = News::join('news_lang', 'news_lang.parentid', '=', 'news.id')
->select(array('news.id','news.typew','news_lang.title','news.date'))
->orderBy('news.date', 'DESC')->where('news_lang.lang', 'tr');

         return Datatables::of($data)
        ->edit_column('title', '{{str_limit($title, $limit = 45, $end = "...")}}')
        ->edit_column('typew', '{{$typew == "news" ? "news":( $typew=="social" ? "social" :( $typew=="voice" ? "voice":"none"))}}')

        ->add_column('actions', '<a   data-button="{{{ URL::to(\'admin/news/\' . $id . \'/edit\' ) }}}"    class="btn btn-success btn-sm event_button" ><span class="glyphicon glyphicon-pencil"></span> </a>
            <a   data-button="{{{ URL::to(\'admin/media/\' . $id . \'/get\' ) }}}"    class="btn btn-success yellow btn-sm event_button" ><span class="glyphicon glyphicon-picture"></span></a>
                <a  id="{{$id}}" data-toggle="confirmation" data-original-title="{{ Lang::get("admin/news.confirma_delete") }}"  class="btn btn-sm btn-danger item_deletew"><span class="glyphicon glyphicon-trash"></span></a>
                <input type="hidden" name="row" value="{{$id}}" id="row">')


        ->make();

My jquery:

oTable = $('#table').dataTable({
"sDom" : "<'row'<'col-md-6'l><'col-md-6'f>r>t<'row'<'col-md-6'i><'col-md-6'p>>",
"sPaginationType" : "bootstrap",

  "bProcessing" : true,
  "bServerSide" : true,
  "sAjaxSource" : "{{ URL::to('admin/news/data/') }}",
  "fnDrawCallback" : function(oSettings) {
     Metronic.init();
    UIConfirmations.init(); 

get data :

ata?sEcho=1&iColumns=5&sColumns=%2C%2C%2C%2C&iDisplayStart=0&iDisplayLength=10&mDataProp_0=0&sSearch_0=&bRegex_0=false&bSearchable_0=true&bSortable_0=true&mDataProp_1=1&sSearch_1=&bRegex_1=false&bSearchable_1=true&bSortable_1=true&mDataProp_2=2&sSearch_2=&bRegex_2=false&bSearchable_2=true&bSortable_2=true&mDataProp_3=3&sSearch_3=&bRegex_3=false&bSearchable_3=true&bSortable_3=true&mDataProp_4=4&sSearch_4=&bRegex_4=false&bSearchable_4=true&bSortable_4=true&sSearch=&bRegex=false&iSortCol_0=0&sSortDir_0=asc&iSortingCols=1&_=1427536607841

@illuminate3
Copy link

I don't think you are calling this properly. That error is normally when columns don't match.

Try some of the code the I've posted in this issue;
#12

@yajra
Copy link
Owner

yajra commented Mar 29, 2015

Hi, the lower version of Datatables (v1.9 and below) is a little buggy on this package so i suggest you update your version to Datatables v1.10++ and follow the codes @illuminate3 has posted on #12 if possible.

But anyways, I have some bug fix for lower version yesterday. Try checking it out and test again. Thanks!

@yajra
Copy link
Owner

yajra commented Apr 7, 2015

should be fixed on latest version.

@yajra yajra closed this as completed Apr 7, 2015
@github-actions github-actions bot locked and limited conversation to collaborators Nov 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants