Board Logo

setting the application up for client-changed table content
ydor - 8/16/2002 at 08:53 AM

For now table sorting is made in only ascending order. If user clicks 'descending sort' arrow, the table content is just reversed. Such way saves about 90% of time on descending data sorting, but does not allow to change table content on client side.

So if you need the table data to be updated at clients after the page is loaded, some modifications to Tigra Tables PRO code are required.

To do them find following lines in 'table.do.ok.js' file (default directory is 'ttp_files'):

if (coln==sort.col) content.body=content.body.reverse()
else Tqs(id,coln-1,0,rows-1,caption.types[coln-1])

and replace these lines with lines:

Tqs(id,coln-1,0,rows-1,caption.types[coln-1])
if (ordn!=0) content.body=content.body.reverse()

Table content is stored in JavaScript array named Ttables[id].content.body, where id is Tigra table zero-based index on a page.

Once you've changed content you should initialise current page index:
Ttables[id].page.c = 0;

clear filtering if needed:
Ttables[id].fil_pat = '';

and repaint the table:
Ttable_show(id);

Please, don't forget what id is and note: a time of sorting in descendindg order after modification will be reduced by a time of sorting in ascending order


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/