Results 1 to 3 of 3

Thread: problem with GridPanel

  1. #1

    Default problem with GridPanel

    Hi all,
    I've a little bit problem with this code (I'm using extjs 3.2.1) :

    var groupStore = new{
    	baseParams: '',
    	method: 'POST',
    	url: ';',
    	root: 'results',
    	fields: [ 'gid', 'groupname', 'accesslevel', 'groupdesc' ],
    var groupGrid = new Ext.grid.GridPanel({
    	store: groupStore,
    	selModel: new Ext.grid.RowSelectionModel({singleSelect:false}),
    	loadMask: true,
    	border: false,
    	autoload: true,
    	columns: [
    		new Ext.grid.RowNumberer(),
    		{ id: 'gid', header: "GID", dataIndex: 'gid', width: 25 },
    		{ header: "Name", dataIndex: 'groupname'/*, width: '40%'*/ },
    		{ header: "AccessLevel", dataIndex: 'accesslevel', /*width: '60%',*/ menuDisabled: true },
    		{ id: 'description-col', header: "Description", dataIndex: 'groupdesc', /*width: '60%',*/ menuDisabled: true }
    	defaults: {
    		sortable: true,
    		menuDisabled: false
    	viewConfig: {
    I think the problem is that I don't display any data because I don't call groupGrid.load() . But other examples I saw the groupGrid.load() called first of groupGrid in onReady() method i.e.:

    var groupGrid = new Ext.grid.GridPanel({
    but I have to call groupStore.load() inside groupGrid = new Ext.grid.GridPanel({.. HERE..});

    how can i do ?

  2. #2
    Sencha User brittongr's Avatar
    Join Date
    Jun 2007


    autoLoad is intended for this:

    autoLoad : Object/String/Function
    A valid url spec according to the Updater Ext.Updater.update method. If autoLoad is not null, the panel will attempt to load its contents immediately upon render.
    The URL will become the default URL for this panel's body element, so it may be refreshed at any time.

    So basically, you load content of another url inside the panel, note that autoLoad is inherited...

    If what you want is to set store autoLoad then move that config option to the store.

    You can call store.load(); before or after instantiate the gridPanel, but if you set autoLoad: true on store you don't need to call explicitly store.load...
    Greivin Britton

    My Extensions:
    Ext.ux.NumericField: Number field with support for currencySymbol, thousand separator, international...
    Ext.ux.PagerSizeSelector: A plugin that allows the change page size with just one click.
    Ext.ux.FieldAccess: A plugin to let the user know which fields are editable.

  3. #3

    Wink [SOLVED] problem with GridPanel

    I've solved. there were two problems :
    1)the "method" it were "GET" Altough i've setted to POST in the userStore, I've setted it after userStore definition.

    var userStore = new{
        baseParams: '',
        url: 'http://blabalbla.......',
        totalProperty: 'totalCount',
        root: 'results',
        id: 'uid',
        fields: [ 'uid', 'username', 'gid', 'email', 'password' ]
    userStore.proxy.conn.method = 'POST'; // <--------
    2) I had to add the listener function "render" in order to "load" the data.


Posting Permissions

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