first time useing grouping and I don’t know how to fix this problem.
March 10th, 2010 | Posted by rose under enart.qthx.com withThis is the first time I have used grouping and I don’t know what else to do to fix this problem.
var ds = new Ext.data.JsonStore({
url: './data-search.php?string= echo $search; ?>',
root: 'data',
fields: [
'link',
'meta',
'type'
]
});
ds.load();
Ext.onReady(function() {
Ext.QuickTips.init();
// turn on validation errors beside the field globally
var reader = new Ext.data.ArrayReader({}, [
{name: 'link'},
{name: 'meta'},
{name: 'type'}
]);
Ext.form.Field.prototype.msgTarget = 'side';
// create the Grid
var grid = new Ext.grid.GridPanel({
width:500,
height:550,
frame:true,
bodyStyle:'text-align:left;',
title:'Search results for " echo $search; ?>"',
store: new Ext.data.GroupingStore({
reader: reader,
data: Ext.grid.ds,
sortInfo:{field: 'name'},
groupField:'type'
}),
columns: [
{id:'link',header: "Link", width: 100, sortable: true, locked:false, dataIndex: 'link'},
{header: "Meta", width: 200, sortable: true, dataIndex: 'meta'},
{header: "Type", width: 200, sortable: true, dataIndex: 'type'}
],
view: new Ext.grid.GroupingView({
forceFit:true
})
});
grid.render('results');
});Thanks,
Levi
Thanks for the help, I can now head off to the pub gilt free.
:D
I was hoping that would be a nice easy fix, however that didn’t seem to fix the problem.
Found an error with GroupingStore but that didn't seem to help either.
Any other suggestion?
Its Friday afternoon and I want to go have a few drinks however I cant go until I get this going. :(( What a cruel would... ;)
var ds = new Ext.data.JsonStore({
url: './data-search.php?string=test',
root: 'data',
fields: [
'link',
'meta',
'type'
]
});
Ext.onReady(function() {
Ext.QuickTips.init();
// turn on validation errors beside the field globally
var reader = new Ext.data.ArrayReader({}, [
{name: 'link'},
{name: 'meta'},
{name: 'type'}
]);
Ext.form.Field.prototype.msgTarget = 'side';
// create the Grid
var grid = new Ext.grid.GridPanel({
//maxHeight:550,
frame:true,
bodyStyle:'text-align:left;',
title:'Search results for',
store: new Ext.data.GroupingStore({
reader: reader,
data: Ext.grid.ds,
sortInfo:{field: 'link'}, // <-- was name not link
groupField:'type'
}),
columns: [
{id:'link',header: "Link", width: 100, sortable: true, locked:false, dataIndex: 'link'},
{header: "Meta", width: 200, sortable: true, dataIndex: 'meta'},
{header: "Type", width: 200, sortable: true, dataIndex: 'type'}
],
view: new Ext.grid.GroupingView({
forceFit:true
})
});
grid.render('results');
ds.load();
});
I didn't think it mattered what type of Store i used. I gave it a go with an Array as well and same issue.
#If you have any other info about this subject , Please add it free.# |