row details : fnOpen or fnAddData
row details : fnOpen or fnAddData
Hi
sorry, i've not been very lucky using datatables live tool, but this is the link i can propose :
http://live.datatables.net/emayev/2/edit
all js is in the html part
So I'm new to datatables
What I do now :
I build a classic DOM table. I fill my cells with 'y' and 'n' values. Then with mRender, I replace these values with icons for each columns. This works good and is pretty fast.
This table shows rights on a given folder. User's rights are the result of the sum of rights that one user gets from its own rights and from the groups he belongs to.
Now I would to show some details about users, when clicking on the plus at the left of the row.
By now, I've based my script on the example given on datatables site :
http://www.datatables.net/release-datatables/examples/api/row_details.html
So my script works nearly the same way. The difference is that I get content from an ajax request. You can click on the plus on the live link, it will work but ajax request will fail, with no content.
The content I get from an ajax request looks like this :
[code]
ind_id_1067
nynnnynny
[/code]
What I would like to do is just to show the details in the same way I show main rows of the table. I have same switch values (y/n) at exactly the same place. I would just render new rows with italic and maybe a smaller police size for the first column.
How can I do that ? Should I use fnOpen or fnAddData ?
Can someone give me some clues please ? I don't know where to go.
And I'm not sure fnAddData will let me add rows at place I would like, just like fnOpen.
With fnOpen it creates a new table that I need to format just like the main one, and it looks hard to do it after ajax load.
What I need to do is add/remove some rows at the place just below the chosen row, with same rendering process that happens on the main table.
Thanks in advance for your help
Regards
Fred
sorry, i've not been very lucky using datatables live tool, but this is the link i can propose :
http://live.datatables.net/emayev/2/edit
all js is in the html part
So I'm new to datatables
What I do now :
I build a classic DOM table. I fill my cells with 'y' and 'n' values. Then with mRender, I replace these values with icons for each columns. This works good and is pretty fast.
This table shows rights on a given folder. User's rights are the result of the sum of rights that one user gets from its own rights and from the groups he belongs to.
Now I would to show some details about users, when clicking on the plus at the left of the row.
By now, I've based my script on the example given on datatables site :
http://www.datatables.net/release-datatables/examples/api/row_details.html
So my script works nearly the same way. The difference is that I get content from an ajax request. You can click on the plus on the live link, it will work but ajax request will fail, with no content.
The content I get from an ajax request looks like this :
[code]
ind_id_1067
nynnnynny
[/code]
What I would like to do is just to show the details in the same way I show main rows of the table. I have same switch values (y/n) at exactly the same place. I would just render new rows with italic and maybe a smaller police size for the first column.
How can I do that ? Should I use fnOpen or fnAddData ?
Can someone give me some clues please ? I don't know where to go.
And I'm not sure fnAddData will let me add rows at place I would like, just like fnOpen.
With fnOpen it creates a new table that I need to format just like the main one, and it looks hard to do it after ajax load.
What I need to do is add/remove some rows at the place just below the chosen row, with same rendering process that happens on the main table.
Thanks in advance for your help
Regards
Fred
This discussion has been closed.
Replies
finally I got the answer myself
just have to build the table with an id and call datatables on it, with same mRender options and some different options for the sdom ("sDom": 't')
fnOpen very good for that
Thanks to anyone who took time to read
Have a nice christmas break !
Fred