![]() |
Ignited DataTables - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Ignited DataTables (/showthread.php?tid=32173) |
Ignited DataTables - El Forum - 04-11-2011 [eluser]ηυмвєяσηє[/eluser] dobbler, i have updated the library. it should work now. download it again. edit: we have also updated wiki. Ignited DataTables - El Forum - 04-11-2011 [eluser]Chauzu[/eluser] Hi, this is an awesome job, just wondering if it's possible to pass parameters to the custom filters from the view. I'm checking the Datatable's multifilter plugin without luck. Ignited DataTables - El Forum - 04-11-2011 [eluser]dobbler[/eluser] Thanks for your quick response ηυмвєяσηє! Ignited DataTables - El Forum - 04-12-2011 [eluser]Chauzu[/eluser] Answering to myself, it is possible to send parameters from the view to the custom filters, just need to match the 'sName' Datatable property to the column's name and use the Multifilter plugin. Again, thanks for this awesome work. Ignited DataTables - El Forum - 04-15-2011 [eluser]Mario Ropič[/eluser] Hello! I am using dataTables with Codeigniter 2 and I have problems with server-side datas.. I have attached screens to this post with two errors.. This is my controller code: Code: function datatables() This is my JavaScript code: Code: $('#example').dataTable({ What am I doing wrong? Regards, Mario Ignited DataTables - El Forum - 04-16-2011 [eluser]ηυмвєяσηє[/eluser] well, first u've called 5 columns from controller (2from table,1 from joins, 2 from customs). Code: 'aoColumns' : [ and if u don't use the id value in custom columns, u can do this simply. Code: $custom_columns['edit'] = array('Edit'); Code: $custom_columns['edit'] = array('Edit $1', array('products.products_id')); plus, be sure the path is right, Code: 'sAjaxSource' : <?php echo base_url(); ?>'server/datatables', edit : and u need a file that called ajax.php in view folder. Code: $this->load->view('ajax', $data); Code: <?php echo $result ?> these are things i have noticed at first look. IF these doesnt work, Click [+] on POST, and copy the error here. Regards, Yusuf Ignited DataTables - El Forum - 04-16-2011 [eluser]cLin[/eluser] I have a question custom columns...would i be able to run operations in it? Currently, I have a variable like Code: $custom_columns['ctr'] = array('$1/$2', array('sq_rows_cleaned.clicks', 'sq_rows_cleaned.impressions')); Also, how would I be able to run statements in there? For example, sometimes $2 (impressions) would appear as zero and if it tries to run any number divided by zero, it'll show up as an error. Before I had a statement like Code: if($impression == 0) { $ctr = ""; } else { $ctr = number_format($clicks/$impressions, 2, '.', '')*100; } Would I be able to do something like that in my listener before it outputs the results? Thanks in advance for any help Ignited DataTables - El Forum - 04-16-2011 [eluser]ηυмвєяσηє[/eluser] hmm.. you didnt add "sq_rows_cleaned.impressions" as a column neither $columns and $join, did you ? "impressions" column should be selected. After that, it shouldnt give errors. and about running operations; i prefer to do that at js part. use fnRender pref. and eval("50/20") will return the value as an example. lets say its 5th column in the table. { "sName": "ctr", "fnRender": function (oObj){return eval(oObj.aData[4]);} }, Regards Yusuf Ignited DataTables - El Forum - 04-16-2011 [eluser]Mario Ropič[/eluser] Quote:ηυмвєяσηє Thank you for your reply. I get now another error: Code: invalid label POST answer: Code: {"sEcho":1,"iTotalRecords":"1377","iTotalDisplayRecords":"1377","aaData":[["7925","11.6700","VI MIŠ OPTIČNA IZVLEČNA ČRNA 0,75 m 23241","Edit","Delete"],["7924","4.6700","VI MIŠ OPTIČNA USB 800DPI ČRNA\/SREB 22859","Edit","Delete"],["8454","81.3700","RTC SESALEC VELIKI+MALI BSC2300 1021003","Edit","Delete"],["7926","13.7000","EDN MIŠKA NOTEBOOK LASER USB 81094","Edit","Delete"],["7927","14.2500","EDN MIŠKA ZA NOTEBOOK OPTICAL 81035","Edit","Delete"],["8457","50.1800","RTC WELLNESS SET WLS 100 1029002","Edit","Delete"],["8455","31.1200","RTC STOJEČI MEŠALNIK S POSODO HMS 300 1014002","Edit","Delete"],["8456","27.5000","RTC STROJ ZA SENDVIČE ALULINE V3 IN 1 1023003","Edit","Delete"],["8010","1.4400","VI PODLOGA ZA MIŠ FABRIK 3 COLORS 21429","Edit","Delete"],["7879","41.6600","RAZER MIŠ DIAM.3G 1800 FROST BLUE","Edit","Delete"]],"sColumns":"products.products_id,products.products_price,products_description.products_name,edit,delete"} Thank you! Ignited DataTables - El Forum - 04-16-2011 [eluser]ηυмвєяσηє[/eluser] Invalid label error is usually caused by validation.js, if u have that update it. |