Reputation: 55
I am working on devextreme dxdatagrid, where I want to show a button in the end of the lookup column dropdown, which will show a popup when clicked.
I searched in the document section but didn't found anything relevant to it.
Please help me to achieve it, ll be thankful if a fiddler example is provided.
Upvotes: 1
Views: 1926
Reputation: 1074
You can customize a lookup editor in the grid's onEditorPreparing event handler.
Here is a code to add a button at the bottom of lookup editor:
onEditorPreparing: function(e){
if(e.row.rowType === "data" && e.dataField === "formatID") {
var advancedSearchItem = {
template: function(){
return $("<div>").dxButton({
text: "Advanced search",
onClick: function(args) {
alert("click");
}
});
}
};
e.editorOptions.dataSource = e.lookup.items;
e.editorOptions.dataSource.push(advancedSearchItem);
}
},
Here is a link to the jsfiddle example: http://jsfiddle.net/jbkabrq3/
Upvotes: 4