Hey guys,
I am using SmartGWT 2.2 with GWT 2.1.
Love the product so far...just having a weird issue and was hoping that you could tell me what I am doing wrong.
I have a ListGrid with three fields. One of them is editable via a SpinnerItem. Everything seems to work great. The only issue I am having is that if I set grid.setAlwaysShowEditors to true, then I get an error in the console :
WARN:ListGrid:isc_ListGrid:isc_ListGrid_0:ListGrid.refreshCell(): first parameter rowNum not present, returning
Here is my code:
Here is my ApplicationData clasee
And Finally the ApplicationRecord
Any advice would be greatly appreciated.
Thanks in advance,
Matt Curry
I am using SmartGWT 2.2 with GWT 2.1.
Love the product so far...just having a weird issue and was hoping that you could tell me what I am doing wrong.
I have a ListGrid with three fields. One of them is editable via a SpinnerItem. Everything seems to work great. The only issue I am having is that if I set grid.setAlwaysShowEditors to true, then I get an error in the console :
WARN:ListGrid:isc_ListGrid:isc_ListGrid_0:ListGrid.refreshCell(): first parameter rowNum not present, returning
Here is my code:
Code:
applicationGrid.setShowAllRecords(true);
applicationGrid.setWidth100();
ListGridField application = new ListGridField("application", "Application");
ListGridField currentThreads = new ListGridField("currentThreads", "Current Threads");
currentThreads.setType(ListGridFieldType.INTEGER);
ListGridField newThreads = new ListGridField("newThreads", "New Threads");
newThreads.setType(ListGridFieldType.INTEGER);
SpinnerItem threadSpin = new SpinnerItem();
threadSpin.setStep(1);
newThreads.setEditorType(threadSpin);
newThreads.setCanEdit(true);
applicationGrid.setAlwaysShowEditors(true);
applicationGrid.setFields(new ListGridField[] {application, currentThreads, newThreads});
applicationGrid.setData(ApplicationData.getRecords());
Code:
public class ApplicationData {
private static ApplicationRecord[] records;
public static ApplicationRecord[] getRecords() {
if (records == null) {
records = getNewRecords();
}
return records;
}
public static ApplicationRecord[] getNewRecords() {
final int MAX_APPS = 25;
final int appcount = (int)(MAX_APPS*Random.nextDouble())+ 5;
ArrayList<ApplicationRecord> appRecords = new ArrayList<ApplicationRecord>();
int threads = 0;
for(int i=0; i<appcount; i++){
int row = i+1;
String appName = "app" + row;
threads = Random.nextInt(200);
appRecords.add(new ApplicationRecord(appName, threads, threads));
}
ApplicationRecord[] returnArray = new ApplicationRecord[appRecords.size()];
return appRecords.toArray(returnArray);
}
}
Code:
public class ApplicationRecord extends ListGridRecord{
public ApplicationRecord(String application, final int currentThreads, final int newThreads) {
this.setAttribute("application", application);
this.setAttribute("currentThreads", currentThreads);
this.setAttribute("newThreads", newThreads);
}
}
Thanks in advance,
Matt Curry