Categories > TinyButStrong general >

Questions TBS-> MergeBlock ()

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Ronei
Date: 2009-06-17
Time: 20:40

Questions TBS-> MergeBlock ()

   
I have two questions:

1st How to use the data loaded by $ TBS-> MergeBlock () in PHP, not only in html.

2nd How do I use the data loaded by $ TBS-> MergeBlock () outside of the HTML table where the data were loaded, Example:

echo "<form name='F20SA' action='index.php' method='post'  onSubmit='return checkEditvFields(this)'>";
echo '<table border="0" width="540" id="alter">';
echo '<tr class="dif" onMouseOver=this.className="" onMouseOut=this.className="dif">';
echo '<td align="center"><font face="verdana" size="1">[blk_lista_sd101.A1_MATRICULA;block=tr]</font> </td>';
echo '</tr>';
echo '</table>';

"   
Well the first part of the code that I carry a list with data, up there all right, but in part to low, I need only a field of the first block within a text input
"

echo '<table border="0" width="160" id="alter">';
echo "<tr><td width='110'><label>CH Previta</label></td> <td width='110'><label>CH Dada</label></td></tr>";
echo "<tr><td><input name='chprev'type='text'value=''size='10' maxlength='10' onkeypress='mascara(this,soNumeros)'> </td>
          <td><input name='chdada'type='text'value='0'size='10' maxlength='10' onkeypress='mascara(this,soNumeros)'> </td></tr>";
echo '</table>';

   
Now to do this using javascript for most q I have an easier way, because if I was doing a report in HTM the block meets the more detail the header, I would have to do another Select another block to fill it?

and need help.
By: Skrol29
Date: 2009-06-17
Time: 21:43

Re: Questions TBS-> MergeBlock ()

Hi Ronei,

I don't understand why you are using echo() since your are using a template engine.

1) and 2) : You can merge several blocks with the same data:
$TBS->MergeBlock('blk_lista,blk_2,blk_3', 'mylsq', 'SELECT * FROM table1');

And you can also ask to return the merged data as a PHP array:
$data = $TBS->MergeBlock('blk_lista,blk_2,blk_3,*', 'mylsq', 'SELECT * FROM table1');
By: RwD
Date: 2009-06-17
Time: 21:55

Re: Questions TBS-> MergeBlock ()

I think it is wise to first look at the examples page on this website and try to recreate some of the examples you see there. Ever since I started using tbs the function "echo" I only use for debugging, tbs handles all output.
By: Ronei
Date: 2009-06-17
Time: 22:02

Re: Questions TBS-> MergeBlock ()

Legal tips thank you!
By: RwD
Date: 2009-06-17
Time: 22:17

Re: Questions TBS-> MergeBlock ()

One thing I forgot to mention is that you can read $TBS-Source. It contains the html up untill what you've done to it at that point. But when you start using tbs there are little reasons I can think of why you would use that. I built it into a self built framework that utilizes parts and pieces where needed and unlike what I said before I do not let tbs handle output, but I read "$TBS->Source" and store that untill needed.
By: Ronei
Date: 2009-06-18
Time: 13:00

Re: Questions TBS-> MergeBlock ()

I know that the TBS-Source I can use directly in html, plus has a problem to use as I'm doing? This implies something along the Server?