Categories > TinyButStrong general >

how to render a dynamic block in onload

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: YuHao
Date: 2011-04-18
Time: 18:22

how to render a dynamic block in onload

I am doing a simple project with tbs,it's an useful tool.but i have some problem when using it .

I have a page to list various result sets from stored procedures accroding to the post parameter. all of these result sets  have various columns,
so i designed a solution: config the column name in an array,use stored procedure to get data from stored procedure.
like
global $data;
$table=array('id','name','address'),

then use the tbs to show outputs.

<tr><td>[row.[onload.table.$;block=td];block=tr]  <td></tr>

i expect after the onload,this html will be replaced <tr><td>[row.id;block=tr]  <td><td>[row.name;block=tr]  <td><td>[row.address;block=tr]  <td></tr>
but in fact, the tbs will return an error with onload.table.$.

how can i get the result i wanted? Does anybody has another solution?
thanks for every friends who are using tbs.
thanks for help.
By: Skrol29
Date: 2011-04-18
Time: 23:15

Re: how to render a dynamic block in onload

Hi YuHao,

You have to use a MergeBlock() for the columns:

HTML:
<tr><td>[row.[col.val;block=td];block=tr] <td></tr>
PHP:
$TBS->MergeBlock('col', $table);
$TBS->MergeBlock('row', $source, 'SELECT ...');