Jump to content

Collapsible Table Help Please


mrclark219

Recommended Posts

Hello all,

 

I am fairly new to the php world and I created a table from my mysql database, but the table is extremely large. I need a way to make this table collapsible. Sort of like a show/hide type feature.  Is this possible?  Any help would be greatly appreciated!!

 

This is the code I used to pull the data from the database, not sure if that will help at all but its worth the try!

 

$xmlDoc->addTable($stock->addRelation('purchaseOrders')->getData(array('purchaseOrders.dbPurchaseOrderNumber', 'purchaseOrderParts.dbVendorNumber', 'purchaseOrders.dbPurchaseDate', 'purchaseOrders.dbReceived', 'purchaseOrderParts.dbQuantity'), NO_PRIMARY_KEY,'purchaseOrderParts.dbPartNumber="' . $partNumber . '" ORDER BY purchaseOrders.dbPurchaseDate DESC LIMIT 100'), CONTENT_NODE, array('TABLE'=>array('SHOW_HEADER'=>'1', 'LABEL'=>'Purchase Orders')));

if(!$stock->addRelation('purchaseOrders')->numRows)

$xmlDoc->addData('No results found', $dataTag);

 

$xmlDoc->addTag('HR', $hrTag);

 

Thanks,

 

Thomas Clark

Link to comment
https://forums.phpfreaks.com/topic/171304-collapsible-table-help-please/
Share on other sites

Well I can think of a few ways.

 

1. Use LIMIT $offset, $count in your query. This way you will only see $count number of rows starting from $offset.

2. Use JavaScript each x number of row add an empty row that has a collapse button in it when clicked it shows/hides all rows that has it's prefix. Use element.style.display = 'block' to show and element.style.display = 'none' to hide. An example of what I mean can be found here: http://framework.zend.com/about/faq

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.