Welcome Guest, Not a member yet? Register   Sign In
Ignited DataTables
#61

[eluser]cryogenix[/eluser]
because the datatables javascript fetches the data via ajax.
#62

[eluser]nomie7[/eluser]
how can I use tabletools extra with your library?
#63

[eluser]petroz[/eluser]
I wrote another library for the Datatables.net plugin. This one supports joins. You can check it here.

http://datatables.dyndns-web.com/
#64

[eluser]Pegasus275[/eluser]
How to use it with action column for example edit/delete etc.

<tr>
<td> id from db</td>
<td> name from db </td>
<td> <a href="edit....">Edit</a>
</tr>
#65

[eluser]petroz[/eluser]
I use a callback on the Datatables.net configuration to generate the table on the fly. Add `fnDrawCallback` to attach any javascript function/method to the generation process.

Here is one for adding columns.

Datatables.prototype.addDataColumn = function()
{
$("#datatable tr:gt(0)").append("<td><a href=''>View</a>&nbsp;<a href=''>Edit</a>&nbsp;<a href=''>Delete</a></td>");
}
#66

[eluser]HiTek[/eluser]
[quote author="Pegasus275" date="1299088827"]How to use it with action column for example edit/delete etc.[/quote]

I expanded cryogenix's datatable class and add additional columns here.
#67

[eluser]petroz[/eluser]
Do you have a link?
#68

[eluser]HiTek[/eluser]
[quote author="petroz" date="1299144535"]Do you have a link?[/quote]
Here is link to my Blog. I put here some description and improved class as well (find the download link at the end of the post). But... this class is for PostgreSQL.

Hmmm... I think I have such class for MySQL too.
#69

[eluser]cryogenix[/eluser]
[quote author="Pegasus275" date="1299088827"]How to use it with action column for example edit/delete etc.

<tr>
<td> id from db</td>
<td> name from db </td>
<td> <a href="edit....">Edit</a>
</tr>[/quote]

you can use petroz's client side solution to create additional columns:

[quote author="petroz" date="1299116938"]I use a callback on the Datatables.net configuration to generate the table on the fly. Add `fnDrawCallback` to attach any javascript function/method to the generation process.

Here is one for adding columns.

Datatables.prototype.addDataColumn = function()
{
$("#datatable tr:gt(0)").append("<td><a href=''>View</a>&nbsp;<a href=''>Edit</a>&nbsp;<a href=''>Delete</a></td>");
}[/quote]

or you can also modify the library where I commented:
Code:
/*
  add additional columns here
  like adding a Delete Row control for example:

  $aaData[$row_key][] = '<a href="#">Delete Button</a>';
*/
#70

[eluser]dobbler[/eluser]
Hi, thanks for everyone's work on this but I just can't get it working and it's driving me insane!

I just get "Loading..." on the table in the view but when I hit the listener I get this:

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: sOrder

Filename: libraries/Datatables.php

Line Number: 143


A Database Error Occurred

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$sOrder $sLimit' at line 4

SELECT SQL_CALC_FOUND_ROWS EmailId, Subject, Added FROM $table $sWhere $sOrder $sLimit

It's weird, from the error it looks like the variables aren't being replaced. I've tried everything but can't seem to make any sense of it. I'm sure I'm missing something (like a decent brain..)

I can post any code you need but I really just copied the samples and altered the table & row variables.

CI version: 1.6.3 - (could be this??? - it's a huge critical app so have been reluctant to upgrade but think I may have to. Going to try it on 1.7.3 and see if it works now that I think of it..)

Any help would be greatly appreciated as I'm under pressure!

Thanks,

Rob.




Theme © iAndrew 2016 - Forum software by © MyBB