I can create a picklist, multi-column combobox, and set the value programmatically. The function getValue() returns the correct value. The function getSelectedRecord() returns 'undefined'.
Is setting the value suppose to select the record with the corresponding value?
Is setting the value suppose to select the record with the corresponding value?
Code:
<!DOCTYPE html> <html> <head> <title></title> <meta charset="utf-8" /> </head> <body> <script type="text/javascript"> var isomorphicDir = "/isomorphic/";</script> <script type="text/javascript" src="/isomorphic/system/modules/ISC_Core.js"></script> <script type="text/javascript" src="/isomorphic/system/modules/ISC_Foundation.js"></script> <script type="text/javascript" src="/isomorphic/system/modules/ISC_Containers.js"></script> <script type="text/javascript" src="/isomorphic/system/modules/ISC_Grids.js"></script> <script type="text/javascript" src="/isomorphic/system/modules/ISC_Forms.js"></script> <script type="text/javascript" src="/isomorphic/system/modules/ISC_DataBinding.js"></script> @ <script type="text/javascript"> var _cboDsConfig = []; isc.DataSource.create({ ID: "_dsConfigSchema", fields: [ { name: "DisplayID" , title: "Config ID" , type: "text", length: 40 }, { name: "Title" , title: "Title" , type: "text", length: 40 }, { name: "Description", title: "Description", type: "text", length: 255 }, { name: "Datime" , title: "Date" , type: "text", length: 40 }, { name: "ID" , title: "ID" , type: "text", length: 40 } ], clientOnly: true }); isc.DynamicForm.create({ ID: "_cboConfigDdl", left: 0, titleSuffix: "", zIndex: 100, width: 715, height: 20, fields: [ { ID: "_cboConfigFields", type: "select", width: 715, clientOnly: true, optionDataSource: _dsConfigSchema, autoFetchData: false, canEdit: false, valueField: "ID", displayField: "DisplayID", pickListWidth: 715, pickListFields: [ { name: "DisplayID" , width: 70 }, { name: "Title" , width: 250 }, { name: "Description", width: 300 }, { name: "Datime" , width: 70 }, { name: "ID" , width: 1, type: "hidden" } ] } ] // fields }) // DynamicForm // Return object to be appended to data source function AddConfig(displayID, title, description, datime, id) { var obj = new Object(); obj.DisplayID = displayID; obj.Title = title; obj.Description = description; if (arguments.length > 3) { obj.Datime = datime; if (arguments.length > 4) obj.ID = id; } return obj; } _cboDsConfig.push(AddConfig('1st - Display', '1st - Title', '1st - Description', '1st - Date', '1st - ID')); _cboDsConfig.push(AddConfig('2nd - Display', '2nd - Title', '2nd - Description', '2nd - Date', '2nd - ID')); _cboDsConfig.push(AddConfig('3rd - Display', '3rd - Title', '3rd - Description', '3rd - Date', '3rd - ID')); _cboDsConfig.push(AddConfig('4th - Display', '4th - Title', '4th - Description', '4th - Date', '4th - ID')); _cboConfigFields.optionDataSource.testData = _cboDsConfig; _cboConfigFields.fetchData(); _cboConfigFields.enable(); _cboConfigFields.canEdit = true; _cboConfigFields.setValue('3rd - ID'); var v = _cboConfigFields.getValue(); var r = _cboConfigFields.getSelectedRecord(); alert('getValue: ' + v); alert('getSelectedRecord: ' + r); </script> </body> </html>
Comment