On the internet to check a lot of information on the ExtJS Processing action Bar "delete", "edit", "view detailed" processing, the original project is to deal with this:
Action Bar: { text: ' Operation ', xtype: ' Actioncolumn ', items: [{ icon: ']. /images/edit.png ', tooltip: ' Edit ', handler:function (grid, RowIndex, Colindex) { var record = Grid.getstore (). GetAt (RowIndex); var data = Record.data; var demoinfoform = ext.create (' Core.demo.view.DemoInfoForm ', { parent:grid, title : ' Add/Edit ' }); demoinfoform.show (); } }] }
Online Search a lot of information, one is to modify the source code, the other is the use of pictures, which is the above. If there is only one situation, for example, only: edit, if there are two columns in a column: for example, "edit" "View" "Delete" this is more troublesome.
I'm here to provide a single "edit" when the processing, here I used to click on the cell to trigger the event, because there is only one column of the formula bar, so deal with it.
The specific code is as follows:
Processed code: { text: ' Chat history ', dataindex: ' id ', width:80, renderer:function () { return ' <a href= ' # ' & gt; View </a> '; }, listeners: { ' click ': Function (grid, RowIndex, Colindex) { //Get Data var data = Grid.store.data.items[colindex].data; var id = data.id; var demoinfo = ext.create (' Core.demo.view.DemoInfoForm ', { //pass parameter msgId : ID }); Demoinfo.show ();}}}
Here to deal with, return a hyperlink, but the click of the time is to do a listening, listen to the grid of a column of the trigger event, so click on the pop up a form (do not like the picture, feel bad, just so deal with).
Note: ExtJS 4.0
ExtJS Grid Delete, edit, view detailed etc hyperlink processing