javascript - How to get custom data in a combo box -
i trying populate combobox list of project names. able project names, cannot seem figure out how add them custom set of data combobox. have looked using other types of comboboxes (iteration, portfolio, attribute, etc), don't seem have capabilities add custom data drop down list (unless mistaken). here code using combo box:
this.down = this.add({ xtype: 'rallycombobox', storeconfig: [{ model: 'project', autoload: true, fieldlabel: 'projects:', data: this.project_names, width: field_width }] });
when trying run code, "uncaught typeerror: cannot call method 'getproxy' of undefined. cannot figure out how work. have tried following:
this.down = this.add({ xtype: 'rallycombobox', model: 'project', fieldlabel: 'projects:', data: this.project_names, width: field_width });
i still end same error. can me doing wrong? thanks!
if have list of projects in hand you'd use in combobox, instead of rally combobox i'd recommend using ext combobox. rally combobox designed populate store querying data rally - getproxy
error seeing when trying mix , match rally wsapi store local data.
the setup might following.
// data store containing list of projects var projectstore = ext.create('ext.data.store', { fields: ['_ref', 'name'], data : [ {"_ref": "/project/12345678910", "name": "project 1"}, {"_ref": "/project/12345678911", "name": "project 2"}, {"_ref": "/project/12345678912", "name": "project 3"} //... ] }); // create combo box, attached projects data store this.projectselector = ext.create('ext.form.combobox', { fieldlabel: 'choose project', store: projectstore, querymode: 'local', displayfield: 'name', valuefield: '_ref', listeners:{ scope: this, select: function(combobox) { // stuff here console.log('ref of project selected: ' + this.projectselector.getvalue()); } } }); this.down('#projectselectorcontainer').add(this.projectselector);
hopefully helpful. let know if there's follow-on questions.
Comments
Post a Comment