Closed flmn closed 13 years ago
I create a MUI.List like file Source/Controls/list/index.html, if I add two commands, like:
MUI.create('MUI.List', { id: container + 'datatypelist', container: container, clearContainer: true, alternateRows: true, content: {url: 'datatypes', paging: {size: 10, totalCount: 200, recordsField: false}}, columns: [ {text: 'Name', name: 'typeName', value: 'typeName'}, {text: 'Created At', name: 'createdAt'} ], commands: [ {text: 'Delete', name: 'Delete', image: '{theme}images/cancel.png'}, {text: 'Edit', name: 'Edit', image: '{theme}images/o-magnifier.png'} ], onItemCommand: function(item, self, cmd) { if (cmd.name == 'Edit') { // do some thing } } });
When I click Delete command, in onItemCommand function, I also get the cmd.name to 'Edit', not 'Delete' as expect. I think this function always set cmd to last command in commands list.
this has been fixed, just pull new version or check last commit
Thanks very much.
I create a MUI.List like file Source/Controls/list/index.html, if I add two commands, like:
When I click Delete command, in onItemCommand function, I also get the cmd.name to 'Edit', not 'Delete' as expect. I think this function always set cmd to last command in commands list.