Embed Combobox and easyuidatagrid in the DataGrid of EasyUI
When working on the project, you need to embed Combobox in the DataGrid of EasyUI. After several days, with the help of everyone, you can finally see how it looks like:
The core code is as follows:
<Html>
In the Combobox editor, the data source url: '/News/returnisenableddata' corresponds to the method in the corresponding Controller (in fact, it is a very simple json string in the background ):
Public string ReturnIsShowData () {string strJson = "[{\" id \ ": \" yes \ ", \" text \ ": \" yes \"}, {\ "id \": \ "no \", \ "text \": \ "no \"}] "; return strJson ;}
When the value in Combobox is selected, you only need to write the operation to be executed in the onAfterEdit (index, row, changes) function. index is the row number to be edited. The default value starts from 0; row is the entire row where the edited cell is located. row. the column name can obtain the data of this row, such as row. isShow can obtain the data in the IsShow column of the row where the cell to be edited is located.
(This article is based on Asp.net MVC)
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.