ExtJS Grid Delete, edit, view detailed etc hyperlink processing

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.