PDA

View Full Version : Problem with grouping grid



robert6000
23 Nov 2007, 12:06 AM
Hi,

I've got problem with grouping grid. I have links in my grid and when I group by key or name it show me something like this '<a href="gotoProjectCode.php?project_id"{$projects[prj].code}', as group categor. I want to only project code or name without the text 'href=.....'. How I should to do this??

There is my code:


Ext.onReady(function(){

Ext.QuickTips.init();

var reader = new Ext.data.ArrayReader({}, [
{name: 'key'},
{name: 'name'}
]);

var grid = new Ext.grid.GridPanel({
store: new Ext.data.GroupingStore({
reader: reader,
data: Ext.grid.cost_data,
sortInfo:{field: 'key', direction: "ASC"}
}),

columns: [
{header: "Key", width: 20, sortable: true, dataIndex: 'key'},
{id:'name', header: "Name", sortable: true, dataIndex: 'name'},
],

view: new Ext.grid.GroupingView({
forceFit:true,
hideGroupedColumn: true,
groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
}),

collapsible: true,
animCollapse: false,
autoHeight: true,
renderTo: 'project_list_-grid'
});
});

Ext.grid.cost_data = [
{/literal}
{section name=prj loop=$projects}
['<a href="gotoProjectCode.php?project_id"{$projects[prj].code}',
'<a href="gotoProjectName.php?project_id"{$projects[prj].name}',]
{if !$smarty.section.prj.last},{/if}
{/section}
{literal}
];