-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
select field issue with String ID #2
Comments
Yes, current SelectField implementation inherits NumberField and parses selected value to number. Of course, it should work for strings too. { name: "source", title:"Source", type: "select",
items: db.sources, valueField: "Id", textField: "Name"
editValue : function() { return this.editControl.val(); }, // for editing
filterValue : function() { return this.filterControl.val(); }, // for filter
insertValue : function() { return this.insertControl.val(); } // for insert
} You also could define a new field to avoid grid config cluttering. Just register a new field inheriting from jsGrid.SelectField with following code: function TextSelectField(config) {
jsGrid.SelectField.call(this, config);
}
TextSelectField.prototype = new jsGrid.SelectField({
sorter: "string",
filterValue: function() {
return this.filterControl.val();
},
insertValue: function() {
return this.insertControl.val();
},
editValue: function() {
return this.editControl.val();
}
});
jsGrid.fields.textSelect = TextSelectField; Now you can use this field just like before, but specify |
I'm having an issue with using a String for the valueField in a select. When I select a new item from the select the cell goes blank.
See: http://jsbin.com/repexoyuqi/ (click a row, change the select value, click the first button on the control cell)
The text was updated successfully, but these errors were encountered: