Fritz Zaucker wrote:
Hi Skar,
On Tue, 6 Oct 2009, skar wrote:
I'm using the smart table for search as type. When I receive more than
zero rows, there is no problem. However, when I get empty(zero rows)
result, I can't setData with an empty array due to the check at
source/class/smart/Smart.js" line 1273.
can you try
setData([[]]);
for the moment?
I get the following error if I try the above:
TypeError: rowdata[this.buildarg.search_col[i]] is undefined
Any idea on how to work around this? Basically, setData expects at least
1 row in the passed data array. I couldn't find any resetData method, so
don't know how to empty the table.
I didn't think about the problem of "emptying" the table when I added this
check. My idea was to enforce a valid parameter (array of arrays).
I'll think about it a bit more ...
The first check should be if length is greater than zero, else return
immediately. Or have a special resetData function so that the user can
call it when there are no rows to set.
Also, how much faster Smart Table is, instead of searching for the
string in the row data and then using the matched rows in a separate
array for the table model?
Also, when reloading data from the server, the previous selection
remains. For eg, if I've selected row 9 and 10, then reload data from
the server, the new 9th and 10th row are still selected. Any way to
reset selection when setting the new data?
I am not sure if this is a bug or a feature ... Dave?
How does it behave in the simple model? You should be able to reset with
table.clearSelection()
Thanks, that did the job for me :)
cheers,
skar.
--
--
The life so short, the craft so long to learn.
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel