[Dojo-interest] dojox.grid.DataGrid.selection.getSelected odd behaivour.

xiaowen zhu zhuxw1984 at gmail.com
Tue May 1 22:31:44 EDT 2012


Hi, this is well-known issue of grid. The getSelected function will return
NULL on row items that are not in cache. But this function does trigger a
request to load these uncached rows. That's why you can get them in a
second call. Currently there's no good way to solve this except hacking the
grid a rewrite the getSelected method. As a work around (not good though),
you can just call the getSelected after some timeout.

On Thu, Apr 26, 2012 at 10:04 PM, <Jose.L.Leviaguirre at shell.com> wrote:

> Hi, ****
>
> ** **
>
> It seems that the getSelected method does not return all the selected
> items the first time it's called for a grid with a checkbox selector.****
>
> ** **
>
> When trying to process the selected items on a grid:****
>
> ** **
>
>                 dojo.forEach(grid.selection.getSelected(), function(item,i) {
> ****
>
>                     var val = grid.store.getValue(item,"vendor");****
>
>                     console.log(i,"-",val)****
>
>                 })****
>
> ** **
>
> My grid has 100 items and it only outputs a portion of it, unless I call
> that function again:****
>
> ** **
>
> 0 - ADU MONIAS             ****
>
> 1 - AMOCO            ****
>
> 2 - DAWSON****
>
> :
> 49 - SWAN****
>
> ** **
>
> The fisrt time, I get the following error at item # 50 in dojo.js line 60:
> ****
>
> ** **
>
> dojo.data.ItemFileReadStore: Invalid item argument.    (60 out of range 15)
> ****
>
> ** **
>
> I notice the error is gone once I scroll down the grid or the function is
> called a second time. ****
>
> ** **
>
> Here is a jsfiddle <http://jsfiddle.net/jleviaguirre/79KYh/>****
>
> ** **
>
> Help is kindly appreciated!****
>
> ________________________________________________________
> Dojotoolkit: http://dojotoolkit.org
> Reference Guide: http://dojotoolkit.org/reference-guide
> API Documentation: http://dojotoolkit.org/api
> Tutorials: http://dojotoolkit.org/documentation
>
> Dojo-interest at mail.dojotoolkit.org
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-interest/attachments/20120502/bb29bbef/attachment.htm 


More information about the Dojo-interest mailing list