On Fri, Mar 18, 2011 at 10:23, Luc Saffre <[email protected]> wrote:

> On 18.03.2011 14:42, Derrell Lipman wrote:
> > Some people love the column ids. Personally, I've never found a great
> > use for them. When they're used, however, they re typically strings, not
> > numbers, and without looking at the code, I'm not sure what problems
> > using numbers would cause. Also, I think when you use them, the format
> > of your data returned by the server must be in the map format, not the
> > simple array format as you're using.
> >
> > To test my hypothesis, please remove the second parameter to
> > tm.setColumns() and see if your results are more favorable.
>
> Derrell, thanks for not leaving me alone.
>
> Yes it's true that most examples and the docs seem to say that the
> individual rows should be maps and not arrays. So I tried your suggestion::
>
>      tm.setColumns(
>        [ "ID", "name", "name (et)", "Category", "vatExempt", "price",
> "description", "description (et)" ],
>         [ "id", "name", "name_et", "cat", "vatExempt", "price",
> "description", "description_et" ]
>      ); // columnNameArr, columnIdArr
>
> and changed the server to respond like this::
>
>  { "count": 10, "rows": [
>   { "name_et": "Laud puidust", "catHidden": 1, "name": "Wooden table",
>     .... },
>   { "name_et": "Tool puidust", "catHidden": 1, "name": "Wooden chair",
>     ...}, ...
>  ],
>  "title": "Products"
>  }
>
> But sorry, you don't get the prize: unfortunately the problem remains.
> Or I'd rather say *fortunately* because AFAICS from the source,
> qx.ui.table.model.Remote perfectly supports simple arrays instead of
> maps. I prefer to use simple lists (not maps) because it saves bandwidth
> and client memory, and it would be redundant to repeat the column names
> for each row of a table.
>

Nope, you misunderstood me. I wanted you to make ONLY the one-line change of
removing the column id values from the call to tm.setColumns(), so that it
looks like this:

tm.setColumns(
  [  "ID", "name", "name (et)", "Category", "vatExempt",
    "price", "description", "description (et)" ]);

Note that only one parameter is passed. Then go back to your original data
being returned from the server. With that configuration, you're using the
Remote data model in the way that it's typically used, and it should work
for you.

Have you looked at the Remote Data Model example in the demobrowser or in
the RpcExample contrib? These are both working examples of using that model.
(You'll need to download the demobrowser source to see what it's doing,
since it uses some classes that don't show up in the Source panel.)

Cheers,

Derrell
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to