Results 1 to 2 of 2

Thread: Grid custom renderer selected cell value

  1. #1

    Default Grid custom renderer selected cell value

    Good afternoon ladies and gents,

    Is it possible to access the selected row's value from within the custom renderer

    for example in the following code

    i would like to send an http request if a user clicks on the cell http://localhost:8080/test/testservlet?attribute=page1&id="'+record

    the value of record isn't being replaced, I tried store.getAt(1) as well didn't know

    Wonder if any one can shed some light thanks.

     var grid = new Ext.grid.GridPanel({
                store: store,
                columns: [
                    {id:'ID',header: "ID", width: 160, sortable: true, dataIndex: 'ID'},
                    {header: "Name", width: 75, sortable: true, dataIndex: 'Name', 
                     renderer: function(value, metaData, record, rowIndex, colIndex, store) {
                        //The <a> tag is used to create an anchor to link from
                        //the href attribute is used to address the document to link to
                        //the words between the open and close of the anchor tag will
                        //be displayed as a hyperlink (value).
                        //the target attribute defines where the linked document will
                        //be opened (_blank = open the document in a new browser window)
                        return '<a href="http://localhost:8080/test/testservlet?attribute=page1&id="'+record+' target="_parent">'+ value +'</a>';
                     }//end renderer
                    {header: "Address", width: 75, sortable: true, dataIndex: 'Address'}
                stripeRows: true,
                autoExpandColumn: 'ID',
                title:'Array Grid'

  2. #2
    Sencha User
    Join Date
    Apr 2008
    Hong Kong


    the 'record' is so you can use record.get(xxx) or to retrieve the data.
    or you can use 'cellclick' event of GridPanel to achieve the same.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts