DataTables - Server-side Processing in Codeigniter using Ajax

Поділитися
Вставка
  • Опубліковано 15 жов 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!!

  • @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

  • @sultanbuyan9502
    @sultanbuyan9502 Рік тому

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

  • @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?

  • @sokoyaphilip6058
    @sokoyaphilip6058 7 років тому +5

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

  • @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();

  • @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?

  • @matiasvaldiviezo9594
    @matiasvaldiviezo9594 7 років тому

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

  • @SHIVANAN2010
    @SHIVANAN2010 3 роки тому

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

  • @muhammadusman1798
    @muhammadusman1798 5 років тому

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

  • @kanatechsystems7446
    @kanatechsystems7446 7 років тому +3

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

  • @rommypun5136
    @rommypun5136 6 років тому

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

  • @waleedahmed6373
    @waleedahmed6373 6 років тому

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

  • @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.

  • @alfathah3163
    @alfathah3163 5 років тому

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

  • @frodas4ever
    @frodas4ever 5 років тому

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

  • @proxygulshan
    @proxygulshan 3 роки тому

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

  • @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

  • @mohammaduzzwal5011
    @mohammaduzzwal5011 6 років тому

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

  • @mujahidkhanbabar
    @mujahidkhanbabar 6 років тому

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

  • @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.

  • @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

  • @AsifShaikh-pe6sr
    @AsifShaikh-pe6sr 4 роки тому

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

  • @sameedulhassan5432
    @sameedulhassan5432 4 роки тому

    Thanks a lot for such an amazing and brief tutorial

  • @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

  • @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 ?

  • @rahulkkk5187
    @rahulkkk5187 4 роки тому

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

  • @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.

  • @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

  • @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.

  • @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();

  • @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.

  • @mfblorilla
    @mfblorilla 6 років тому

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

  • @shahadatkhan8461
    @shahadatkhan8461 7 років тому

    Sir thanks, for this helpful concept.

  • @syehajiana7169
    @syehajiana7169 5 років тому

    hello @weslesson, please help me, order not working

  • @winstonsimon8001
    @winstonsimon8001 6 років тому

    can load this codes, because of ajax dataTables

  • @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

  • @aetken
    @aetken 5 років тому

    very well sir, you are great

  • @daoanimation1862
    @daoanimation1862 3 роки тому

    Thanks!!! I hope you use your voice soon

  • @hac02803
    @hac02803 5 років тому

    Thanks a lot! Very good tutorial. It works!

  • @annandl
    @annandl 4 роки тому

    why my image do not appear

  • @wEbCoAdEr
    @wEbCoAdEr 5 років тому +1

    Great Tutorial
    Thanks a lot, man!

  • @sajalkhanvlogs4646
    @sajalkhanvlogs4646 5 років тому

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

  • @user-sum722
    @user-sum722 6 років тому

    thank you!!! have a nice day!

  • @harshupadhyay1254
    @harshupadhyay1254 6 років тому

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

  • @slayer5171
    @slayer5171 5 років тому

    Undefined index: length how to fix this?

  • @saimikram202
    @saimikram202 6 років тому

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

  • @farshadangouti7214
    @farshadangouti7214 4 роки тому

    very good ,tank you

  • @jorgeabarca5970
    @jorgeabarca5970 6 років тому

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

  • @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????

  • @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

  • @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'));

  • @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...

  • @akhedy4905
    @akhedy4905 6 років тому

    How to join table in datatable?

  • @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???

  • @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)

  • @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

  • @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.

  • @alvaroguedez9373
    @alvaroguedez9373 7 років тому

    Thanks man, very usefull!

  • @ahsankalim8594
    @ahsankalim8594 6 років тому

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

  • @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.

  • @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

  • @agoomi3503
    @agoomi3503 6 років тому

    thanks a lot !

  • @AsepSaepuloh
    @AsepSaepuloh 7 років тому

    Thank's bro,

  • @4dprintlv82
    @4dprintlv82 4 роки тому

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

  • @jeewakagamage4372
    @jeewakagamage4372 7 років тому

    Thanks a lot

    • @webslesson
      @webslesson  7 років тому

      Always welcome! Jeewaka Gamage.

  • @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?

  • @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

  • @PedroSilva-du6cl
    @PedroSilva-du6cl 6 років тому

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

  • @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 років тому

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

    • @darshikadesai5557
      @darshikadesai5557 4 роки тому

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

  • @foodeverest8294
    @foodeverest8294 5 років тому

    Nothing get wastage of time bakwaass 2 lines ka code hei

  • @poorez_11
    @poorez_11 7 років тому

    You sound robotic

  • @dipeshpatel8233
    @dipeshpatel8233 3 роки тому

    Status Code: 303 See Other

  • @chemseddineh.9987
    @chemseddineh.9987 4 роки тому

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

  • @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

  • @danyraid
    @danyraid 4 роки тому

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

  • @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.

  • @muhammadusman1798
    @muhammadusman1798 5 років тому

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