1. SmartClient Version: v9.0p_2013-07-25/LGPL Development Only (built 2013-07-25)
2. IE 9.0.8112.16421
3. Non-server issue
5. No JavaScript error
I could use some help diagnosing a problem I'm running into trying to migrate for 3.1 to 4.0.
I have a case where I am manually loading data into a ListGrid. The code looks similar to this:
After this completes, the grid shows the message "No items to show" as if there is no data in the grid. I've added a button to my code with a click handler and in the click handler I display the number of records in the grid. The display shows 10 (even though the grid is still showing "No items to show").
My actual code is a lot more complex than this (e.g., lots of custom options/settings no the grid, using a derivation of ListGridRecord for the records, data filled in after async call to a server, etc.). I've tried stripping this down to a simple example to show what is happening, but the simple example works fine.
Can you point me to any information or tools that might help identify what is causing the grid in my more complex case to display the empty message instead of the data?
In addition, the documentation on setData is confusing. It says that it can only be called from the constructor (which I am not doing), and if you are doing this outside of the constructor you should call the method setData instead. This make no sense because that is the same method. Is the documentation about what to do after the constructor referring to the incorrect method name? What should I use instead?
We've been using this same code in a shipping product for almost 2 years and it has been working fine until I tried to roll from 3.1 (from last November) to 4.0.
2. IE 9.0.8112.16421
3. Non-server issue
5. No JavaScript error
I could use some help diagnosing a problem I'm running into trying to migrate for 3.1 to 4.0.
I have a case where I am manually loading data into a ListGrid. The code looks similar to this:
Code:
final ListGridSetData listGrid = new ListGridSetData(); listGrid.setEmptyMessage("Loading..."); List<ListGridRecord> recordList = new ArrayList<ListGridRecord>(); for (int i = 0; i < 10; ++i) { ListGridRecord record = new ListGridRecord(); record.setAttribute("Col1", "Row" + i + " Col1"); record.setAttribute("Col2", "Row" + i + " Col1"); recordList.add(record); } ListGridRecord[] records = new ListGridRecord[recordList.size()]; recordList.toArray(records); listGrid.setData(records); listGrid.setEmptyMessage("No items to show");
My actual code is a lot more complex than this (e.g., lots of custom options/settings no the grid, using a derivation of ListGridRecord for the records, data filled in after async call to a server, etc.). I've tried stripping this down to a simple example to show what is happening, but the simple example works fine.
Can you point me to any information or tools that might help identify what is causing the grid in my more complex case to display the empty message instead of the data?
In addition, the documentation on setData is confusing. It says that it can only be called from the constructor (which I am not doing), and if you are doing this outside of the constructor you should call the method setData instead. This make no sense because that is the same method. Is the documentation about what to do after the constructor referring to the incorrect method name? What should I use instead?
We've been using this same code in a shipping product for almost 2 years and it has been working fine until I tried to roll from 3.1 (from last November) to 4.0.
Comment