Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Aug 2008
    Posts
    5
    Vote Rating
    0
    ddouden is on a distinguished road

      0  

    Default Gridfilter using datastore

    Gridfilter using datastore


    Hi All,
    I'm trying to get the following working.

    In the gridfilter I would like to use a datastore instead of fixed filter options.

    Now I’ve tried to use the store variable, this does give me the correct amount of options but does not show any text in the menu, and if clicked on it the filter does not filter correctly.

    Does anybody know an solution?

    Datastore for the filter:
    Code:
    var ds_type = new Ext.data.Store({
       id: 'TypeDataStore',
       proxy: new Ext.data.HttpProxy({
                 url:'db/type_asset_db.php', 
                 method: 'POST'
             }),
       reader: new Ext.data.JsonReader({
         root: 'results',
         totalProperty: 'total',
         id: 'cmdb_type_desc'
       },[ 
                 {mapping: 'cmdb_type_desc', name: 'cmdb_type_desc'}
       ])
    });
    The filters
    Code:
    var filters = new Ext.grid.GridFilters({
    filters:[
        {type: 'string',  dataIndex: 'System_ID'},
        {type: 'string',  dataIndex: 'System_Name'},
        {type: 'numeric', dataIndex: 'System_HD_Size'},
        {type: 'date',    dataIndex: 'System_EnterDate'},
        {type: 'string',  dataIndex: 'System_Model'},
        {type: 'list',
       dataIndex: 'cmdb_type_desc',
           //  options: ['Desktop', 'Laptop', 'Mobiele Telefoon', 'PDA', 'Token'],
           store: ds_type,
           phpMode: true
        },
    {type: 'numeric', dataIndex: 'System_Responsible'},
       {type: 'string',  dataIndex: 'Status_Desc'}
    ]});

  2. #2
    Sencha User kouphax's Avatar
    Join Date
    Mar 2007
    Location
    Belfast
    Posts
    58
    Vote Rating
    0
    kouphax is on a distinguished road

      0  

    Default


    I am having a similar issue to yourself. Did you ever get it resolved?

    I have got a step further and managed to get the text to display. Add this,

    {type: 'list', dataIndex: 'fromAccount', store: accountStore, labelField:'name'}

    UPDATE

    Anotehr bit further I don't know how to correctly fix this but In the ListMenu class the onload function is assigning the itemId equal to that of the current record. This means the labelField value is being checked against the record id rather than the actual data it should be. I made this change to the ListMenu class and it works (this is a breaking change though so shouldn't be relied upon)

    Code:
    	onLoad: function(store, records){
    		var visible = this.isVisible();
    		this.hide(false);
    		
    		this.removeAll();
    		
    		var gid = this.single ? Ext.id() : null;
    		for(var i=0, len=records.length; i<len; i++){
    			var item = new Ext.menu.CheckItem({
    				text:    records[i].get(this.labelField), 
    				group:   gid,
    				checked: this.selected.indexOf(records[i].id) > -1,
    				hideOnClick: false});
    			
    			item.itemId = records[i].data.name; /* I DID A CHANGE */
    			item.on('checkchange', this.checkChange, this);
    						
    			this.add(item);
    		}
    		
    		this.loaded = true;
    		
    		if(visible)
    			this.show();
    			
    		this.fireEvent('load', this, records);
    	},
    UPDATE 2

    Actually How stupid of me - if you specify the id to be the same as your labelField value you'll be flying

    ... reader: new Ext.data.XmlReader({record: 'account', id:'name'}, Account), ...
    Last edited by kouphax; 26 Nov 2008 at 2:17 AM. Reason: update on problem

  3. #3
    Sencha User
    Join Date
    Sep 2007
    Posts
    1
    Vote Rating
    0
    szederl is on a distinguished road

      0  

    Default


    better to use this:

    Code:
     /** @private */
    	onLoad: function(store, records){
    		var visible = this.isVisible();
    		this.hide(false);
    		
    		this.removeAll();
    		
    		var gid = this.single ? Ext.id() : null;
    		for(var i=0, len=records.length; i<len; i++){
    			var item = new Ext.menu.CheckItem({
    				text:    records[i].get(this.labelField), 
    				group:   gid,
    				checked: this.selected.indexOf(records[i].id) > -1,
    				hideOnClick: false});
    			
    			item.itemId = records[i].get(this.labelField); /* USING labelField INSTEAD OF an user specific store field */
    			item.on('checkchange', this.checkChange, this);
    						
    			this.add(item);
    		}
    		
    		this.loaded = true;
    		
    		if(visible)
    			this.show();
    			
    		this.fireEvent('load', this, records);
    	},

  4. #4
    Sencha User
    Join Date
    Aug 2008
    Posts
    5
    Vote Rating
    0
    ddouden is on a distinguished road

      0  

    Default After all these years of trying

    After all these years of trying


    Hi All,

    First of all thanks for the input of getting the solution.

    After some while of trying I decided to skip the issue and use the standard options: [].

    Recently I had to make a new version of the application with new features in it.
    Started with Architect 2 to build is in extjs 4.1, got the list filter with store working, but got tangled up in some other head-breaking issue. So got back to the drawing-board with extjs 3.4.

    After some hick-ups I found the solution to my initial problem in Oct 2008.

    Here is my Solution:
    Adjust the file (found in menu folder) - ListMenu.js
    1. Under the constructor : make the following change, replace
    Code:
    this.store.on('load', this.onLoad, this)
    into
    Code:
    } else {
                this.add({text: this.loadingText, iconCls: 'loading-indicator'});
                //this.store.on('load', this.onLoad, this);
                var storeObject = Ext.StoreMgr.lookup(this.store);
                storeObject.on('load', this.onLoad, this);
                this.store = storeObject;
            }
        },
    
        destroy : function () {
    2. then the next step, in the onload
    Code:
    item.itemId = records[i].id;
    into
    Code:
        hideOnClick: false});
                
                //item.itemId = records[i].id;
                item.itemId = records[i].get('id');
                item.on('checkchange', this.checkChange, this);
    Thanks again.
    Hope you will have some fun with it.

Thread Participants: 2