DataTables - Server-side Processing in Codeigniter using Ajax

Поделиться
HTML-код
  • Опубликовано: 1 окт 2024
  • How to create server-side data table with codeigniter and datatables using Ajax. Codeigniter crud ajax jquery, Codeigniter datatables server-side processing, Codeigniter datatables server-side processing, Codeigniter c.r.u.d. with modals & ajax, Codeigniter c.r.u.d. with modals & ajax free download, DataTables server side processing example codeigniter, Bootstrap crud modal, Codeigniter bootstrap modal, Codeigniter bootstrap crud generator, Codeigniter datatables ajax - Source Code - www.webslesson....

Комментарии • 137

  • @alejandrootero3522
    @alejandrootero3522 6 лет назад +37

    Thank you Stephen Hawking!!

  • @CoolEditz
    @CoolEditz 7 лет назад +11

    Am I the only one who absolutely can't stand the voice over in these videos? I can't finish a single one.

    • @Sparshgr8
      @Sparshgr8 7 лет назад +1

      the voice is annoying.

    • @ferdinandtugano
      @ferdinandtugano 5 лет назад +1

      yeah, I prefer Indian accent. aha

    • @aetken
      @aetken 5 лет назад

      yes you are the only one, we enjoy the voice it is great

  • @jadejajaypalsinh7333
    @jadejajaypalsinh7333 6 лет назад +1

    DataTables warning: table id=user_data - Ajax error. For more information about this error, please see datatables.net/tn/7
    face this type of error, how can i fix it???

  • @narendraverma825
    @narendraverma825 5 лет назад +2

    I have 20k records and it's taking 15 sec to load. Is there any other to load fast records? From where you are getting the $_POST["draw"]? In my senario, all the records are displaying but pagination not displaying.

    • @maweryoutube9852
      @maweryoutube9852 5 лет назад

      I have the same issue, please let me know if you could find a solution

    • @cecironalejoiii7680
      @cecironalejoiii7680 5 лет назад

      @@maweryoutube9852 change get_filtered_data() inside function:
      $this->make_query();
      return $this->db->count_all_results();

  • @muktidwijatmoko3385
    @muktidwijatmoko3385 5 лет назад +1

    DataTables warning: table id=user_data - Ajax error. For more information about this error, please see datatables.net/tn/7
    Failed to load resource: the server responded with a status of 500 (Internal Server Error)

  • @sultanbuyan9502
    @sultanbuyan9502 Год назад

    i've a CodeIgniter online project. but it is too much slow. How can I fast loading system? please help me.

  • @sokoyaphilip6058
    @sokoyaphilip6058 7 лет назад +5

    Nice tutorial. I love this, you have showed me direction .
    God bless

  • @historylined4379
    @historylined4379 2 года назад

    the link in the description only got half of the source code can you provide a git link if possible for the whole source code thank you

  • @cecironalejoiii7680
    @cecironalejoiii7680 5 лет назад +1

    For those who are experiencing slow loading speed, change get_filtered_data() inside function:
    $this->make_query();
    return $this->db->count_all_results();

  • @kanatechsystems7446
    @kanatechsystems7446 7 лет назад +3

    Hi how can i implement update and delete button because after searching the next option is always update or delete

  • @proxygulshan
    @proxygulshan 3 года назад

    check all data including another page with pagination to delete all ? plz

  • @dennisngu178
    @dennisngu178 5 лет назад

    $sub_array[] = 'Update';
    Sir, in this code , how I make the update button to call other function in the same controller php file? The code is HTML + php

  • @daoanimation1862
    @daoanimation1862 3 года назад

    Thanks!!! I hope you use your voice soon

  • @hidayat3741
    @hidayat3741 7 лет назад +1

    igot this pop up what should i do.. please help me (DataTables warning: table id=user_data - Ajax error. For more information about this error, please see datatables.net/tn/7)

    • @hardiksinghi8589
      @hardiksinghi8589 7 лет назад

      Check in inspect element>Networks you'll find your mistake. This generally happens when you don't replace tutorials table columns with yours.

    • @jomarcediehina4583
      @jomarcediehina4583 7 лет назад

      Have the same problem. How to fix it?

  • @SHIVANAN2010
    @SHIVANAN2010 3 года назад

    Can we fix a where condition with the query ? I tried but didnot work

  • @danyraid
    @danyraid 4 года назад

    Seriously... You can just talk it through instead of using windows readover... Hearing Sam speak is quite irritating.

  • @marcorafaeltolentino6469
    @marcorafaeltolentino6469 6 лет назад +1

    why the output is this :( "DataTables warning: table id=user_data - Invalid JSON response"
    Dont know how to debug it..

    • @webslesson
      @webslesson  6 лет назад

      For Debug, Please right click on webpage and select inspect element and after this go to networks, you can find what is the error. This step is for chrome browser.

    • @entertainmentmedia8298
      @entertainmentmedia8298 5 лет назад

      same error with me..
      A PHP Error was encountered
      Severity: Warning
      Message: Use of undefined constant member_no - assumed 'member_no' (this will throw an Error in a future version of PHP)
      Filename: models/Admin_model.php
      Line Number: 551

  • @nayanshah5916
    @nayanshah5916 6 лет назад

    DataTables warning: table id=user_data - Invalid JSON response. For more information about this error, please see datatables.net/tn/1 this error to be displayed.

  • @muhammadusman1798
    @muhammadusman1798 5 лет назад

    @Webslesson $_POST['start'] , $_POST['length'] $_POST['order'] ? sir, I am facing these errors could you help me please.

  • @muhammadusman1798
    @muhammadusman1798 5 лет назад

    @Webslesson $_POST['start'] , $_POST['length'] $_POST['order'] ? sir, I am facing these errors could you help me please

  • @4dprintlv82
    @4dprintlv82 4 года назад

    very complex -> table from table, it is very hard to understand by newby

  • @majidkadi
    @majidkadi 6 лет назад

    Hey
    Thanks to much for this tutorial.
    I have a question if possible.
    How to use dependent dropdown in model window with datatable in codeigniter
    See this (example) links:
    www.canal-tech-dz.com/codeigniter/vehicule/
    I want to use a dynamic dependent dropdown like this:
    www.canal-tech-dz.com/codeigniter/dependent_dropdown
    Thanks in advence

  • @chemseddineh.9987
    @chemseddineh.9987 4 года назад

    Subject is exactly what I'm looking for, voice is unbearable.

  • @maruko8324
    @maruko8324 2 года назад

    Why is it that even though I only return specific rows from database using "where" clause, it somehow returns all the data?

  • @ivanc.6064
    @ivanc.6064 4 года назад

    10:59 - he meant direction variable not directory variable
    0:09 - u mean display system not crud there is no create update or delete here

  • @alphonsesossou4283
    @alphonsesossou4283 4 года назад

    thank Stephen for a so helpful tutorial. It works fine with CodeIgniter 3 but in CodeIgniter 4 there is a challenge. Empty data is sent to datatable. I replaced all php magic function $_POST with codeigniter 4 equivalent $this->request->getpost(). This is an example of how I made the changes $this->request->getpost("search")["value"]), considering the fact that the first bracket is for the $_POST array notation. How do I make the code CodeIgniter 4 compliant?

  • @jccastillo1682
    @jccastillo1682 7 лет назад +1

    hi, the example worked, but i don't know why i have this issue, in the model i wanted to add a WHERE clause, where the id = the id who is actually logged, but it doesn't work and still fetching ALL THE DATA ignoring the clause

    • @webslesson
      @webslesson  7 лет назад

      Thank you JC Castillo for writing to us. We appreciate your valuable feedback.

  • @dipeshpatel8233
    @dipeshpatel8233 3 года назад

    Status Code: 303 See Other

  • @sajalkhanvlogs4646
    @sajalkhanvlogs4646 5 лет назад

    Plz make a video on how to join search bar with selecting coloumn by select box

  • @thonguyentan4200
    @thonguyentan4200 5 лет назад +1

    Undefined index: length, Undefined index: start, Undefined index: draw
    Please help me! Give me the file of source code

    • @slayer5171
      @slayer5171 5 лет назад

      same here.

    • @muhammadzain8184
      @muhammadzain8184 5 лет назад

      did you solve the error ?@Danang SP

    • @muhammadzain8184
      @muhammadzain8184 5 лет назад

      anyone solve the error or not ?

    • @slayer5171
      @slayer5171 5 лет назад

      @@muhammadzain8184 No need to fix anything, datatables has build in function to handle that.

  • @AsifShaikh-pe6sr
    @AsifShaikh-pe6sr 4 года назад

    how can i store data in mysqltable for image.Please help me

  • @jccastillo1682
    @jccastillo1682 7 лет назад

    where clause doesn't work here :(
    $this->db->select($this->select_column);
    $this->db->where('todo.user_id', $this->session->userdata('user_id'));
    $this->db->from($this->table);
    $this->db->join('user', $this->table.'.user_id = user.user_id');
    still retrieving me ALL the data

    • @webslesson
      @webslesson  7 лет назад

      Hi JC Castillo, You have write this code in following order, so it will work.
      $this->db->select($this->select_column);
      $this->db->from($this->table);
      $this->db->join('user', $this->table.'.user_id = user.user_id');
      $this->db->where('todo.user_id', $this->session->userdata('user_id'));

  • @md.mizanurrahman2778
    @md.mizanurrahman2778 6 лет назад

    Sir, If you say how can I use join query here then I can solve my issue. Please help me to say about join query in model file.

  • @mujahidkhanbabar
    @mujahidkhanbabar 6 лет назад

    hi i have error
    Message: Undefined index: length
    Filename: models/crudmodel.php
    line number 30.
    Please Help me

  • @alfathah3163
    @alfathah3163 5 лет назад

    I'm sorry , why not select data in the table?

  • @rahulkkk5187
    @rahulkkk5187 4 года назад

    Someone plz tell me one thing,
    Is it's working with filtering data

  • @ahsankalim8594
    @ahsankalim8594 6 лет назад

    Sir!! Can you send mei databse coding??? I'm face troubling in database coding!!

  • @foodeverest8294
    @foodeverest8294 5 лет назад

    Nothing get wastage of time bakwaass 2 lines ka code hei

  • @waleedahmed6373
    @waleedahmed6373 5 лет назад

    when i commented the get_all_data quries it is still fetching all the data? can you tell me why?

  • @harshupadhyay1254
    @harshupadhyay1254 6 лет назад

    Everything is working perfect but i can not get pagination only first page display

  • @rajachikkala2277
    @rajachikkala2277 7 лет назад

    Thank you for your valuable videos. Could you please create a video CRUD transactions by using stored procedures. I don't know how to call stored procedure using Codeigniter framework.

  • @AmreshKumar-gz8ct
    @AmreshKumar-gz8ct 5 лет назад

    i got a error Undefined index: length and Undefined index: start
    while executing a program ...i need ur help webslesson plz make it corret or suggest me to solve this error as soon as possilbe

  • @annandl
    @annandl 4 года назад

    why my image do not appear

  • @frodas4ever
    @frodas4ever 5 лет назад

    Please, how can I style individual row with this datatables setup?

  • @matiasvaldiviezo9594
    @matiasvaldiviezo9594 7 лет назад

    Should be easiest filtering that data with Angularjs in the front end? thanks.

  • @syehajiana7169
    @syehajiana7169 5 лет назад

    hello @weslesson, please help me, order not working

  • @mohammaduzzwal5011
    @mohammaduzzwal5011 6 лет назад

    Really , I learn so many your direction . Thanks a lot . waiting for next

  • @farshadangouti7214
    @farshadangouti7214 4 года назад

    very good ,tank you

  • @hac02803
    @hac02803 5 лет назад

    Thanks a lot! Very good tutorial. It works!

  • @PedroSilva-du6cl
    @PedroSilva-du6cl 6 лет назад

    Tinhas que mostrar passo a passo e devagar para que o entendimento seja melhor

  • @shawnjavier7196
    @shawnjavier7196 6 лет назад

    thankyou for the tutorial .but i encounter an error regarding your code. the error said "datatables warning: table id=user_data - ajax error." how do i fix this error ?

  • @winstonsimon8001
    @winstonsimon8001 6 лет назад

    can load this codes, because of ajax dataTables

  • @sameedulhassan5432
    @sameedulhassan5432 4 года назад

    Thanks a lot for such an amazing and brief tutorial

  • @joycetenorio1398
    @joycetenorio1398 7 лет назад

    DataTables warning: table id=user_data - Ajax error. For more information about this error, please see datatables.net/tn/7 need you help sir :/

    • @nailayousfi4024
      @nailayousfi4024 7 лет назад

      i had the same error, and all i had to do is remove one '}' from model because it was not closing anything

    • @shahadatkhan8461
      @shahadatkhan8461 7 лет назад

      if you tray this source code link of code. then you check config>database.php>database="crud", and create a database crud, table="users", id="id", "first_name", "last_name", "image", after insert sum data than start your page.
      then successfully work

    • @hardiksinghi8589
      @hardiksinghi8589 7 лет назад

      Check in inspect element>Networks you'll find your mistake. This generally happens when you don't replace tutorials table columns with yours.

  • @saimikram202
    @saimikram202 6 лет назад

    Sir can you please explain the benefit of server side datatable using ajax??????

  • @jorgeabarca5970
    @jorgeabarca5970 6 лет назад

    Great Video !!! As always you usually do !! Thanks a lot !!

  • @MultiIronhand
    @MultiIronhand 7 лет назад

    Hello..i´m trying to put a condition "where first_name="nuno" and nothng happens. Every resukts are showing..how can i do?

    • @webslesson
      @webslesson  7 лет назад

      Hi Nuno Cardoso, Can you share your code where you have query, and after this write your query.

    • @jccastillo1682
      @jccastillo1682 7 лет назад +1

      happened the same to me, the "WHERE" clause didn't work for me, i managed this in the controller in the foreach statement, in my case i put the following in the beginning of the foreach:
      foreach( $fetch_data as $row) {
      if( $row->user_id == $this->session->userdata('user_id') ) {
      //the rest of the code....
      }
      }
      i did it because it was fetching ALL the results and i just wanted the ones from the user already logged..... in the model the where condition didn't work but i don't know if is a codeigniter issue or datatable issue, i hope it was some mistake from my ignorance lmao i wish the 'where' actually worked in the model

  • @rommypun5136
    @rommypun5136 6 лет назад

    why Can't I load my data, Do i need to create a ?

  • @wEbCoAdEr
    @wEbCoAdEr 5 лет назад +1

    Great Tutorial
    Thanks a lot, man!

  • @muhammadusman1798
    @muhammadusman1798 5 лет назад

    $_POST['start'] , $_POST['length'] $_POST['order']

    • @darshikadesai5557
      @darshikadesai5557 4 года назад

      hey did u find the solution for this my pagination is not working

  • @wirasudharma237
    @wirasudharma237 7 лет назад

    can you help me? i sopped at function fetch_user() when i try this function not found, error 404 and then show DataTables warning :table id=user_data - ajax error. please help me

    • @shahadatkhan8461
      @shahadatkhan8461 7 лет назад

      if you tray this source code link of code. then you check config>database.php>database="crud", and create a database crud, table="users", id="id", "first_name", "last_name", "image", after insert sum data than start your page.
      then successfully work

    • @jadejajaypalsinh7333
      @jadejajaypalsinh7333 6 лет назад

      i can apply your suggestion but still error

    • @shinryu6146
      @shinryu6146 6 лет назад

      Shahadat Khan id = "id" , pls help

  • @slayer5171
    @slayer5171 5 лет назад

    Undefined index: length how to fix this?

  • @shahadatkhan8461
    @shahadatkhan8461 7 лет назад

    Sir thanks, for this helpful concept.

  • @naptyliusbontery4990
    @naptyliusbontery4990 6 лет назад

    i have an error : A PHP Error was encountered
    Severity: Notice
    Message: Undefined index: length
    Filename: models/modelo.php
    Line Number: 83

    • @naptyliusbontery4990
      @naptyliusbontery4990 6 лет назад

      can u help me? pliz

    • @kush0602
      @kush0602 4 года назад

      @@naptyliusbontery4990 did you find any solution for that????

  • @attaroams
    @attaroams 7 лет назад

    very nice i got it i have one problem can you help me on that,i m trying to joint two table data how to that in this data table plzz show me the direction it will help me a lot thank you

    • @webslesson
      @webslesson  7 лет назад +1

      You have to use inner join query for join two tables data to display on datatables, you have to write which column data from two table should write in select join table query. You can do this jobs, try it.

    • @attaroams
      @attaroams 7 лет назад

      hello sir thatnk for your greta helph,sir i m trying to integrate ck editor in text area but it,s not sending the value can you help me sir please i need it to know thank you

    • @mustafaSMNC
      @mustafaSMNC 6 лет назад

      Hello, did you find the solution? Because i am in same situation. I need to use different database tables in one DataTable.

    • @muhammadusman1798
      @muhammadusman1798 5 лет назад

      @@webslesson $_POST['start'] , $_POST['length'] $_POST['order'] ? sir, I am facing these errors could you help me please.

  • @akhedy4905
    @akhedy4905 6 лет назад

    How to join table in datatable?

  • @sannsong9061
    @sannsong9061 7 лет назад

    I can not run this code. Access forbidden!
    You don't have permission to access the requested object. It is either read-protected or not readable by the server.

    • @hardiksinghi8589
      @hardiksinghi8589 7 лет назад

      Check in inspect element>Networks you'll find your mistake. This generally happens when you don't replace tutorials table columns with yours.

    • @sannsong9061
      @sannsong9061 7 лет назад

      Thanks! Let's me see

    • @sannsong9061
      @sannsong9061 7 лет назад

      Can you help me: DataTables warning: table id=user_data-Invalid JSON response.

  • @aetken
    @aetken 5 лет назад

    very well sir, you are great

  • @AsepSaepuloh
    @AsepSaepuloh 7 лет назад

    Thank's bro,

  • @alvaroguedez9373
    @alvaroguedez9373 7 лет назад

    Thanks man, very usefull!

  • @user-sum722
    @user-sum722 6 лет назад

    thank you!!! have a nice day!

  • @poorez_11
    @poorez_11 7 лет назад

    You sound robotic

  • @agoomi3503
    @agoomi3503 6 лет назад

    thanks a lot !

  • @AlexanderKwalsh
    @AlexanderKwalsh 7 лет назад

    Great tutorials. Can we please have the source code to learn from?

    • @webslesson
      @webslesson  7 лет назад

      Hi King Washington, We have put all video tutorial source code link in the video description, so if want to source code please follow that link thanks...

  • @mfblorilla
    @mfblorilla 6 лет назад

    My program has an error.
    All the post requests doesn't have a value
    $_POST['start'] , $_POST['length'] $_POST['order']

  • @prakashseervi5206
    @prakashseervi5206 7 лет назад

    Sir, How to set where clause for select Some selected data from database in DataTable

    • @webslesson
      @webslesson  7 лет назад

      it is very simple, you have to write where condition, which you have generally use for other operation, you have to write where clause below select query, it is very simple. e.g. where id='1'

    • @prakashseervi5206
      @prakashseervi5206 7 лет назад

      Sir I tried but selected rows was not coming

  • @bogs439
    @bogs439 6 лет назад +1

    Undefined index: length error :( help please

    • @mfblorilla
      @mfblorilla 6 лет назад

      Me too

    • @whocaresrite
      @whocaresrite 6 лет назад

      me too, have u solved it? help pls...

    • @niazmuhammad6606
      @niazmuhammad6606 6 лет назад

      "serverSide": true, s is capital in serverSide

    • @thonguyentan4200
      @thonguyentan4200 5 лет назад

      me too, who know how to solved, please help me!

    • @slayer5171
      @slayer5171 5 лет назад

      @@niazmuhammad6606 doesn't works.

  • @jeewakagamage4372
    @jeewakagamage4372 7 лет назад

    Thanks a lot

    • @webslesson
      @webslesson  7 лет назад

      Always welcome! Jeewaka Gamage.

  • @narendraverma825
    @narendraverma825 6 лет назад

    Can you share the source code?

    • @webslesson
      @webslesson  6 лет назад

      hi you can find source code link under video description.

    • @narendraverma825
      @narendraverma825 6 лет назад

      Oh!! I forgot to check that link...Thanks