PDA

View Full Version : AutoGrid and MetaGrid extensions with 3.0



extjs3user
7 Jul 2009, 2:23 AM
We have been using extjs 2.2 and now we are migrating our code to 3.0. In our application we have extensively used autogrid, metagrid extensions. This has been working perfectly with ext 2.2 after migrating our code to 3.0 this does not work. Is there any work around to be done.

When we migrated our code from 2.2 to 3.0 in these(metagrid and autogrid) extensions we are getting an error in JSonReader#buildExtractors Record.prototype.fields is null

kindly help us.

hendricd
7 Jul 2009, 11:47 AM
We have been using extjs 2.2 and now we are migrating our code to 3.0. In our application we have extensively used autogrid, metagrid extensions. This has been working perfectly with ext 2.2 after migrating our code to 3.0 this does not work. Is there any work around to be done.

When we migrated our code from 2.2 to 3.0 in these(metagrid and autogrid) extensions we are getting an error in JSonReader#buildExtractors Record.prototype.fields is null

kindly help us.


@extjs3user -- Effective Ext 3, you shouldn't need much autoGrid plugin support any more. But, you will need this (http://extjs.com/forum/showthread.php?t=73579) override to get a metaData change to read your records again.

brookd
15 Jul 2009, 2:57 PM
What is new in Ext3.0 that negates the use of autoGrid?

I am also using the autoGrid plugin, which is working in Ext3.0, except the columns widths seem to have been wiped out..

blt_on_ext
6 Aug 2009, 9:19 AM
does anyone know how to use the autogrid-like functionality in ext3?

the documentation hints at it:
http://extjs.com/deploy/ext-3.0.0/docs/?class=Ext.data.JsonReader

and hendricd hints at it. has anyone gotten this to work that would be willing to provide an example?

wheeler
12 Aug 2009, 3:35 AM
var store = new Ext.data.Store({ // should this be a JsonStore? I still get an undefined var error
autoLoad: true,
url: 'url.php',
reader: new Ext.data.JsonReader() // according to JsonReader docs this is all I need if the json contains metaData, correct?
});

var grid = new Ext.grid.GridPanel({
width: 500,
height: 500,
frame: true,
title: 'Example,
store: store,
columns: [] // if I set columns to empty, the panel renders with no columns, but if I remove this line, I get c is undefined and the panel no longer renders
});
Assume the json coming back from the server contains the metaData tag and results located in the Ext.data.JsonReader API example code which blt_on_ext referenced.

Any ideas on what I might be missing?

Condor
12 Aug 2009, 3:56 AM
Ext 3.0 doesn't use metaData to update grid columns.

But it isn't very hard to do this yourself (see example (http://extjs.com/forum/showthread.php?p=371353#post371353)).

wheeler
12 Aug 2009, 5:57 AM
Ah ha. Perfect. Thank you very very much.

genius551v
6 Nov 2009, 10:08 AM
wheeler, can you resolve the problem? can you show us please? tnks

vladi
19 Nov 2009, 2:47 AM
Hi guys,

i've been struggling with this problem for some time now.
I use cakePHP as a backend and it's linked to Ext by CakeXT (http://cakext.mykita.com/trac) .

"This project consists of two parts, the CakeHelper, which gathers information about the data structure from the Cake framework and finally creates a configuration object for the CakePanel ExtJS class. The latter processes the config object it receives and returns a panel with all the CRUD functionalities needed. After the user has edited/created an entry, CakePanel sends back the data to the server for processing."

In some of the creating/editing forms I need another grid and this is where I want to use the metagrid plugin.
I get this error: "o.reader.read is not a function"

this code is in the php helper script that generates the configurations, app\views\helpers\ext.php




$tempArray['xtype'] = "grid";
$tempArray['plugins'] = "metagrid";
$tempArray['store'] = array (http://www.php.net/array)(
"reader"=>"Ext.data.JsonReader()"
,"autoDestroy"=>"true"
,"url"=>"http://localhost/data.txt");
$this->formFields[] = $tempArray;



this is where the config is used




var form = new Ext.ux.CakeForm({
...
items: this.formFields,
dataStore: this.dataStore
...
});


The json with "metadata" is in the file and it is correct since it worked with the first version of the metagrid plugin.
Any sugestion are greatly appreciated. Thanks.

clipgangbloodgang
19 Nov 2009, 4:14 AM
wheeler, can you resolve the problem? can you show us please? tnks

Yep I would like to know it too.

genius551v
26 Apr 2010, 8:31 PM
Hi, please can show the result? please...:-/

tnks a lot...

cwells
26 Aug 2010, 10:17 PM
@extjs3user -- Effective Ext 3, you shouldn't need much autoGrid plugin support any more. But, you will need this (http://extjs.com/forum/showthread.php?t=73579) override to get a metaData change to read your records again.

This is marked as "fixed", but is it still broken in 3.2.1? If so, how do I use the above override? Do I just drop this into my code somewhere before using the grid?