Extending Ext.form.field.Picker I am creating a custom component. Its very similar to a DatePicker but instead of a calendar, I expand a tree with checkboxes. When a node is checked, I have to manually set the value of the textfield with the text of the node. My question is, how can I add/delete nodes to the textfield? For adding I am doing something like
var picker = Ext.create("Ext.tree.Panel", {
store: this.store,
floating: true,
hidden: true,
autoScroll:true,
useArrows:true,
animate:false,
animCollapse:false,
shadow: false,
manageHeight: false,
listeners: {
scope:this,
itemclick: function(view, record, node, rowIndex, e){
record.set("checked", true);
this.setValue(this.getValue()+","+record.data.text); //add tree selection to textfield
}
},
but is there a better way to add tree selections to the textfield?
And more importantly, how will I delete a value, say value2
textfield: value1, value2, value3
onCheckedNodesClick
section. – weeksdev