1. #1
    Sencha User
    Join Date
    Nov 2009
    Posts
    58
    Vote Rating
    -1
    emils is on a distinguished road

      0  

    Default Answered: New inserted row in a grouped grid is not visible ...

    Answered: New inserted row in a grouped grid is not visible ...


    Hi,

    The case is like follows:

    I have grouped grid and a form on right. When a row on the grid is selected, the record is visualized on the form.
    BUT when i insert a record it is not visible in a grid. I am sure that the record is inserted correct in the model and it is "selected" by sellectionmodel of the grid, becouse this record is shown in the form ( with new ID, returned from back-end )


    Is this a bug or i miss something ?


    here is the code:

    Code:
    var SelectedRec = Ext.getCmp("grid").getSelectionModel().getSelection();
    var RegionSTR = SelectedRec[0].get('REGION');
    Ext.Ajax.request({
    	url: 'main.php?type=insert',
    	method: 'POST',
    	params : { region: RegionSTR },
    	success: function(objServerResponse){
    	       var obj = Ext.decode(objServerResponse.responseText);
    		if (obj.success == "true") { 
    			var e = Ext.ModelManager.create({
    				A_ID: obj.data.A_ID,
    				TYPE: obj.data.TYPE,
    				PURPOSE: obj.data.PURPOSE,
    				REGION: obj.data.RegionSTR    // THIS IS GROUPED FIELD
    			}, 'Armeec');			
    	Ext.getCmp('grid').getView().refresh();
    	Ext.getCmp('grid').getSelectionModel().select(e); 
    } else {  
    ***************
    }

  2. Actually you don't insert it in the grid, you only create an instance of the "Armeec" model, to have it in the grid use store.add or store.insert.
    'Ext.ModelManager.create' is deprecated in 4.0.7 use Ext.create instead.

  3. #2
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Chisinau, Moldova
    Posts
    642
    Answers
    21
    Vote Rating
    25
    vadimv will become famous soon enough vadimv will become famous soon enough

      0  

    Default


    Actually you don't insert it in the grid, you only create an instance of the "Armeec" model, to have it in the grid use store.add or store.insert.
    'Ext.ModelManager.create' is deprecated in 4.0.7 use Ext.create instead.

Thread Participants: 1