我们的测试团队要求在我们的消息弹出框中的HTML元素上设置ID或类值。这是为了他们的自动化测试。需要在Extjs MessageBox中的按钮上设置类/标识值
我可以通过在CLS传递值,像这样在对话框面板类值传递:
Ext.Msg.show({ title:'Reset Grid Layout', msg: 'Are you sure that you want to reset the grid layout?', cls:'Reset-Grid-Layout-Message', buttons: Ext.Msg.YESNO, fn: function (response) { if (response == 'yes') { } }, icon: Ext.window.MessageBox.QUESTION });
现在,我们还需要它的按钮,也对正在显示文本。有没有办法让按钮上的值变为cls?
我想这是可能的按钮参数扩展成类似:
buttons : [{name:'but1', cls:'asdf'}, {name:'but2', cls:'asdf2'}]
但谷歌不给我回有用的东西。
请检查此http://www.objis.com/formationextjs/lib/extjs-4.0.0/docs/api/Ext.button.Button.html – Satya