1. #1
    Ext User
    Join Date
    Aug 2007
    Posts
    15
    Vote Rating
    0
    ruso is on a distinguished road

      0  

    Question Submit parameters empty [3.1]

    Submit parameters empty [3.1]


    Hi there, I'm dealing with a grid with row editor and Direct all in ExtJs 3.1... My problem is that for "update, create and delete" the data parameter is always empty. Not sure where the problem is!

    Code:
    {"action":"distribuidora_api","method":"edit","data":[],"type":"rpc","tid":4}
    My grid code is:

    Code:
    Ext.namespace('Ebowe'); //define namespace with some 'name'
      
    Ebowe.distribuidoras = function()
    {
    	/*--Private Properties--*/
    	var moduleItem = 'distribuidora';
    	var moduleTitle = 'Distribuidoras';
    	
    	var mainGrid;
    	var main_store;
    	var main_cm;
    	
    	var fm = Ext.form;	
    	
    	function inicio()
    	{	
    		dataStoreWriter = new Ext.data.JsonWriter({
    			encode: true,
    			writeAllFields: false
    		});			
    	
    		main_store = new Ext.data.DirectStore({
    				paramsAsHash:true,
    				//autoLoad: true,
    				autoSave: true,
    				writer: dataStoreWriter,
    				root: 'datos',
    				idProperty: 'id',
    				totalProperty: 'totalCount',
    				paramOrder: ['start','limit'],
    				baseParams: {
    					start: 0,
    					limit: 100
    				},
    				successProperty : 'success',
    				messageProperty : 'message',
    				fields: [{
    						name: 'id',
    						type: 'int'
    					},
    						'distribuidora'],
    				api: {
    				   read:    distribuidora_api.listado,
    				   create:  distribuidora_api.add,
    				   destroy: distribuidora_api.remove,
    				   update:  distribuidora_api.edit
    				}			
    		});					
    		
    		var Distribuidora = Ext.data.Record.create([{
    			name: 'distribuidora',
    			type: 'string'
    		}]);
    
    	    // *************************************	    
    	    // MAIN CM:
    	    // *************************************	    
    		main_cm = new Ext.grid.ColumnModel([{           
    				header: "Id",
    				dataIndex: 'id',
    				width: 20,
    				sortable: true,
    				hidden: false			   
    	        },{
    	           header: "Distribuidora",
    	           dataIndex: 'distribuidora',
    	           width: 100,
    	           align: 'left',
    			   sortable: true,
    			   editor: {
            	        xtype: 'textfield',
        	            allowBlank: false
    	            }
    	        }
    	    ]);    
    		
    		var editor = new Ext.ux.grid.RowEditor({
    			saveText: 'Actualizar'
    		});		
    		
    	    // *************************************	    
    	    // MAIN GRID:
    	    // *************************************	    
    		mainGrid = new Ext.grid.GridPanel({
    			border:false,
    			closable:true,
    			id: 'distribuidoras_module_cmp',
    			title: moduleTitle,
    			plugins: [editor],
    			ds: main_store,
    			cm: main_cm,	
    			viewConfig: {
    				forceFit:true
    			},
    			autoExpandColumn: 'email',
    			loadMask: true,
    			tbar:[{
    					text:'Reload',
    					tooltip:'Recargar la información de la tabla',
    					iconCls:'brefresh',
    					handler: function () {						
    						main_store.reload();						
    					}
    				},'-',
                    {
                        text:'Nuevo',
                        id: 'users_module_bto_add_referente',
                        tooltip:'Agregar un nuevo item',
                        iconCls:'badd',
    					handler: function(){
    						var e = new Distribuidora({
    							distribuidora: 'Nuevo Item'
    						});
    						editor.stopEditing();
    						main_store.insert(0, e);
    						mainGrid.getView().refresh();
    						mainGrid.getSelectionModel().selectRow(0);
    						editor.startEditing(0);			
                        }                
                    },'-',
                    {
                        text:'Eliminar',
                        id: 'main_bto_delete_' + moduleItem,
                        tooltip:'Eliminar el item seleccionado',
                        iconCls:'bremove',
                        disabled: true, 
                        handler: function () {
    			editor.stopEditing();
    			var s = mainGrid.getSelectionModel().getSelections();
    			for(var i = 0, r; r = s[i]; i++){
    				main_store.remove(r);
    			}
                        }                
                    }                
    		],
    		bbar: new Ext.PagingToolbar({
    		          pageSize: 20,
    	        	  store: main_store,
    			  displayInfo: true,
    			  displayMsg: 'Mostrando del {0} al {1} de {2}',
    			  emptyMsg: "No hay items para mostrar"
    		})
    	})
            
            mainGrid.on('rowclick', function(grid, rowIndex, e)
            {
                Ext.getCmp('main_bto_delete_' + moduleItem).enable();
            });			
    		
    			
    	main_store.load({params:{start:0}});
    	Ext.getCmp('tabs').add(mainGrid).show();
    		
     }; // End function grid;				
    	
    	 /*--Public Area--*/
        return {
    	
    		init: function()
    		{			
    			var temp = Ext.getCmp('distribuidoras_module_cmp');
    			if(!temp){
    				inicio();
                }
    			else
    				Ext.getCmp('tabs').setActiveTab('distribuidoras_module_cmp');
    		}		
    	}
    }();
    My api.js code is:

    Code:
    Ext.app.REMOTING_API = {"url":"\/assets\/api\/extjs\/router.php","type":"remoting","actions":{"pelicula_api":[{"name":"add","len":2,"formHandler":true},{"name":"edit","len":2,"formHandler":true},{"name":"listado","len":1}],"distribuidora_api":[{"name":"add","len":2},{"name":"edit","len":2},{"name":"remove","len":1},{"name":"listado","len":2}]}};

  2. #2
    Ext User
    Join Date
    Mar 2007
    Posts
    24
    Vote Rating
    0
    mdelmarter is on a distinguished road

      0  

    Default


    I have the same issue - the baseParams seem to be being ignored in 3.1

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    24
    Vote Rating
    0
    mdelmarter is on a distinguished road

      0  

  4. #4
    Ext User cerad's Avatar
    Join Date
    Dec 2007
    Posts
    226
    Vote Rating
    0
    cerad is on a distinguished road

      0  

    Default


    Mine seem to work just fine under 3.1.1-beta as well as 3.1.0. Just need to set encode:false per the api documentation. No patch needed.

  5. #5
    Ext User
    Join Date
    Aug 2007
    Posts
    15
    Vote Rating
    0
    ruso is on a distinguished road

      0  

    Default


    Quote Originally Posted by cerad View Post
    Mine seem to work just fine under 3.1.1-beta as well as 3.1.0. Just need to set encode:false per the api documentation. No patch needed.
    You where right... hahaha, it was so easy!!! THANKS!!!!

    encode : Boolean
    true to encode the hashed data. Defaults to true. When using Ext.data.DirectProxy, set this to false since Ext.Direct.JsonProvider will perform its own json-encoding. In addition, if you're using Ext.data.HttpProxy, setting to false will cause HttpProxy to transmit data using the jsonData configuration-params of Ext.Ajax.request instead of params. When using a Ext.data.Store.restful Store, some serverside frameworks are tuned to expect data through the jsonData mechanism. In those cases, one will want to set encode: false, as in let the lower-level connection object (eg: Ext.Ajax) do the encoding.

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi