简体   繁体   English

Extjs 4.X RowEditor 触发“更新”按钮

[英]Extjs 4.X RowEditor trigger 'update' button

The RowEditor plugin on my grid works well but for one my use case I have to trigger the 'update' button programmatically and close the popped up RowEditor panel.我的网格上的 RowEditor 插件运行良好,但对于我的用例之一,我必须以编程方式触发“更新”按钮并关闭弹出的 RowEditor 面板。 For reference, below screenshot:以下截图供参考:

在此处输入图片说明

I have tried below command but it does not seem to trigger the event.我试过下面的命令,但它似乎没有触发事件。

var updtBtn = grid.getPlugin('myPlugin').editor.floatingButtons.child('#update');
myBtn.fireEvent('click', myBtn);

I have created a fiddle to test this: fiddle for RowEditor update firevent我创建了一个小提琴来测试这个: fiddle for RowEditor update firevent

The above command (which did not work) gets executed on below steps:上面的命令(不起作用)在以下步骤中执行:

  1. Click on a row to edit, change the text, do not close the editor popup.单击一行进行编辑,更改文本,不要关闭编辑器弹出窗口。
  2. Now click on the 'Add' button on the grid header, which will add a row.现在单击网格标题上的“添加”按钮,这将添加一行。 This is also when update button fire event need to trigger as per the command I used.这也是需要根据我使用的命令触发更新按钮触发事件的时候。

Any pointers on how to get this working is much appreciated.任何有关如何使这项工作的指示都非常感谢。

To make your edit complete you need to use grid.getPlugin('myPlugin').editor.completeEdit();要使您的编辑完成,您需要使用grid.getPlugin('myPlugin').editor.completeEdit(); instead of myBtn.fireEvent('click', myBtn);而不是myBtn.fireEvent('click', myBtn); . .

Look on fiddle: https://fiddle.sencha.com/#view/editor&fiddle/330o看看小提琴: https : //fiddle.sencha.com/#view/editor&fiddle/330o

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM