Link to home
Start Free TrialLog in
Avatar of udir
udir

asked on

Ext technology + Grid + HyperLink column...

Hi,
I built an ascx that contains a grid.
I need to add a column that the values inside will be links.
The column is :
 {name: 'Title', type: 'string'}  -----> instead of string, somthing like "URL", or "HyperLink"
This doesn't work, so how can it be done?
Thanks
(the code is below...)
<script language="javascript">
Ext.onReady(function(){
 
    var record = Ext.data.Record.create([
        {name: 'RequestId', type: 'float'},
        {name: 'Id', type: 'string'},
        {name: 'Title', type: 'string'}  ***********HERE I NEED TO CHANGE TO HYPERLINK-TEXT/URL
    ]);    
        
    var xmlStore = new Ext.data.Store({            
        url     : "Services/ExtService.aspx?serviceMethod=GetData",
        reader  : new Ext.data.XmlReader({
            record      : Suppliers, 
            totalRecords: "results"}, record
        )
    }); 
    var pagingBar = new Ext.PagingToolbar({
        pageSize    : 10,
        displayInfo : true,
        displayMsg  : '',
        store       : xmlStore
    });
 
    xmlStore.load();
 
    var sm = new Ext.grid.RowSelectionModel({
        singleSelect: true,
        listeners: {
            rowselect: function(sm, row, rec) {
                  }
        }
    });
    
    var reportsGrid = new Ext.grid.GridPanel({
        cm : new Ext.grid.ColumnModel([
            expander,
            {RequestID: 'RequestId', dataIndex: 'RequestorId', hidden: true},
            {header: 'a',sortable: true, dataIndex: 'Id'},
            {header: 'b',sortable: true, dataIndex: 'Title'}                
        ]),
        plugins             : expander,
        collapsible         : false,
        animCollapse        : false,
        sm                  : sm,
        enableHdMenu        : false,
        enableColumnResize  : false,
        store               : xmlStore,
        height              : 400,
        width               : 850,
        viewConfig          : {forceFit : true, scrollOffset:2},
        autoExpandColumn    : 'SecondarySubject',
        frame               : true,
        title               :'results',
        bbar                : pagingBar,
        tbar:[
        {text:,'show', tooltip:'show', tooltipType: 'title'}, 
        {text:'back', handler: back, tooltip:'new search', tooltipType: 'title'}
        ]
    });
 
    reportsGrid.render('grid-results');    
 
 });
</script>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of mrjoltcola
mrjoltcola
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of udir
udir

ASKER

Hi,
what is your -  baseUri?
i get an error:  is not define
I define it to a struts tag (which is in a sitemesh master page):

       var baseUri = '<s:url value="/"/>';


But that maps to the context root of the application

       var baseUri = '/myapp/';
Avatar of udir

ASKER

Great!!
Thanks a lot