Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.