Issues w/ summary row in headers
Issues w/ summary row in headers
tkar
Posts: 2Questions: 0Answers: 0
demo is at http://live.datatables.net/omipul/2
I'm making an inventory page for our internal systems. Given a category of items (ex, fishing lures), it displays details about the qty on hand, and which stores have inventory of them. On request, it also shows the daily sales and days on hand for each store. It includes a summary giving the total quantities for the category for each store. By request, this needs to be at the top of the table, so I put it in the .
Issue 1 is that by putting the summary row as the last row in the , the sorting system is choosing it to use it as the toggle row for sorting. Ideally, I would like it to be the second row.
Issue 2 relates to setting the values in the summary row dynamically. Specifically, for the columns where "bVisible" = true, the javascript "document.getElementById('sales_store_a').innerHTML = sales" breaks, because bVisible eliminates the columns entirely until they are retoggled to display. *Edit* Using this method also breaks the column width synchronization on the table. **Double Edit** calling fnDraw fixes that. Original issue still in play.
What would be the recommended way to resolve these two issues?
I'm making an inventory page for our internal systems. Given a category of items (ex, fishing lures), it displays details about the qty on hand, and which stores have inventory of them. On request, it also shows the daily sales and days on hand for each store. It includes a summary giving the total quantities for the category for each store. By request, this needs to be at the top of the table, so I put it in the .
Issue 1 is that by putting the summary row as the last row in the , the sorting system is choosing it to use it as the toggle row for sorting. Ideally, I would like it to be the second row.
Issue 2 relates to setting the values in the summary row dynamically. Specifically, for the columns where "bVisible" = true, the javascript "document.getElementById('sales_store_a').innerHTML = sales" breaks, because bVisible eliminates the columns entirely until they are retoggled to display. *Edit* Using this method also breaks the column width synchronization on the table. **Double Edit** calling fnDraw fixes that. Original issue still in play.
What would be the recommended way to resolve these two issues?
This discussion has been closed.
Replies
item_table.fnSettings().aoColumns[col_index].nTh.innerHTML = val;
will work, with col_index based off the original table, so it does work with hidden columns.