Need Help with Show and Hide Details Row
Need Help with Show and Hide Details Row
Hi,
I am trying to show and hide a details row using server side info.
1) I added the formatting function for row details
2) I added the live click events that shows and hide the details row
*However I am not able to get a column with the show and hide icon.
-I believe my problem is with the "aoColumns"
-not sure how to define these parameters.
Any help would be greatly appreciated
Bryan
I am trying to show and hide a details row using server side info.
1) I added the formatting function for row details
2) I added the live click events that shows and hide the details row
*However I am not able to get a column with the show and hide icon.
-I believe my problem is with the "aoColumns"
-not sure how to define these parameters.
Any help would be greatly appreciated
Bryan
This discussion has been closed.
Replies
Inside of aoColumns, you need a null entry to build off of. Assuming I wanted the icon in my first row, the first entry inside aoColumns would look like this:
[code]
{
"mDataProp": null,
"bSortable": false,
"sClass": "detailControl",
"sDefaultContent": ''
},
[/code]
In addition to the null mDataProp, I also provide the following:
- make the column not sortable
- add a class that will appear in every cell of this column
- provide some content. In my case, the icon is set as the background of a span. If you want to use an image directly, you would just put the image tag into the content parameter instead of a span as I've done. Whatever markup appears in the sDefaultContent parameter will be what's used to create your icon, I just happen to use a span.
I also needed to add an extra inside my HTML to match up with the new null column in aoColumns.