masoud_tamizy
18 Jan 2012, 1:19 AM
i use ajax proxy for filling Grid from PHP server . but i couldn't do it & i encountered this error message (image in follow link) :
30789
please help me and describe me what is "dc=1326..." in query string?
and how can i do it .
and i need an example for CRUD with Ajax .
...
i need this code to fetch data to Grid :
//Ext.require('*');
Ext.require([
'Ext.data.*',
'Ext.grid.*',
'Ext.panel.*',
'Ext.form.*',
'Ext.util.*',
'Ext.state.*'
]);
Ext.onReady(function() {
var types = Ext.data.Types; // allow shorthand type access
Ext.define('user', {
extend: 'Ext.data.Model',
fields: [
{ name: 'national_code', type: 'string' },
{ name: 'user_id', type: 'int' },
{ name: 'first_name', type: 'string' },
{ name: 'last_name', type: 'string' },
{ name: 'father_name', type: 'string' },
{ name: 'sh_sh', type: 'string' },
{ name: 'sh_s_sh', type: 'string' },
{ name: 'gender', type: 'string' },
{ name: 'birth_date', type: 'date' },
{ name: 'birth_location', type: 'string' },
{ name: 'email', type: 'email' },
{ name: 'home_address', type: 'string' },
{ name: 'home_phone', type: 'string' },
{ name: 'postal_code', type: 'string' },
{ name: 'job_title', type: 'string' },
{ name: 'job_address', type: 'string' },
{ name: 'job_phone', type: 'string' },
{ name: 'mobile', type: 'string' },
{ name: 'fax', type: 'string' },
{ name: 'comment', type: 'string' }
],
validations: [
{type: 'presence', field: 'national_code'},
{type: 'presence', field: 'first_name'},
{type: 'presence', field: 'last_name'},
{type: 'presence', field: 'father_name'},
{type: 'length', field: 'first_name', min: 1, max:45},
{type: 'length', field: 'last_name', min: 1, max:45},
{type: 'length', field: 'father_name', min: 1 , max:45},
{type: 'inclusion', field: 'gender', list: ['Male', 'Female']},
{type: 'exclusion', field: 'username', list: ['Admin', 'Operator']}
]
});
var userstore = Ext.create('Ext.data.Store', {
id:'userstore',
model: 'User',
autoLoad: true,
autoSync: true,
proxy: {
type: 'ajax',
actionMethods: 'POST',
url : 'prepare.php',
reader : {type:'json',root:'users',successProperty: 'success'}
}
});
// Create the Grid
Ext.create('Ext.grid.Panel', {
store: userstore,
selType: 'rowmodel', // 'cellmodel'
loadMask: true,
plugins: [Ext.create('Ext.grid.plugin.RowEditing', {
clicksToEdit: 1,
errorSummary:true})
],
columns: [
{ dataIndex: 'national_code',
hideable: false,
header:'کدملّي',
align:'right' ,
editor : null
},{ dataIndex:'first_name',
text:'نام',
align:'right',
editor: {xtype:'textfield',allowBlank: false}
},{ dataIndex:'last_name',
text:'فاميل',
align:'right',
editor: {xtype:'textfield',allowBlank: false}
},{ dataIndex:'father_name',
text:'نام پدر',
align:'right',
editor: {xtype:'textfield',allowBlank: false}
},{ dataIndex:'sh_sh',
text:'شماره شناسنامه',
align:'right',
sortable:false,
editor: {xtype:'numberfield',allowBlank: false}
},{ dataIndex:'sh_s_sh',
text:'شماره سريال شناسنامه',
align:'right',
editor: {xtype:'textfield',allowBlank: false}
},{ dataIndex:'birth_date',
text:'تاريخ تولذ',
hidden:true,
editor: {xtype:'textfield',allowBlank: false}
},{ dataIndex:'birth_location',
text:'محل تولد',
hidden:true,
align:'right',
editor: {xtype:'textfield',allowBlank: false}
},{ dataIndex:'email',
text:'پست الکترونيک',
hidden:true,
align:'right',
editor: {xtype:'textfield',allowBlank: false}
},{ dataIndex:'home_address',
text:'آدرس منزل',
align:'right'
},{ dtatIndex:'home_phone',
text:'تلفن منزل',
align:'right'
},{ dataIndex:'postal_code',
text:'کد پستي',
align:'right',
},{ dataIndex:'job_title',
text:'شغل',
align:'right',
hidden:true
},{ dataIndex:'job_address',
text:'آدرس محل کار',
align:'right',
hidden:true
},{ dataIndex:'job_phone',
text:'تلفن محل کار',
align:'right',
},{ dataIndex:'mobile',
text:'تلفن همراه',
align:'right'
},{ dataIndex:'fax',
text:'فاکس',
align:'right'
},{ dataIndex:'comment',
text:'توضيحات',
align:'right',
hidden:true
}],
title: 'User List',
height:575,
width:1366,
renderTo: Ext.getBody()
});
});
30789
please help me and describe me what is "dc=1326..." in query string?
and how can i do it .
and i need an example for CRUD with Ajax .
...
i need this code to fetch data to Grid :
//Ext.require('*');
Ext.require([
'Ext.data.*',
'Ext.grid.*',
'Ext.panel.*',
'Ext.form.*',
'Ext.util.*',
'Ext.state.*'
]);
Ext.onReady(function() {
var types = Ext.data.Types; // allow shorthand type access
Ext.define('user', {
extend: 'Ext.data.Model',
fields: [
{ name: 'national_code', type: 'string' },
{ name: 'user_id', type: 'int' },
{ name: 'first_name', type: 'string' },
{ name: 'last_name', type: 'string' },
{ name: 'father_name', type: 'string' },
{ name: 'sh_sh', type: 'string' },
{ name: 'sh_s_sh', type: 'string' },
{ name: 'gender', type: 'string' },
{ name: 'birth_date', type: 'date' },
{ name: 'birth_location', type: 'string' },
{ name: 'email', type: 'email' },
{ name: 'home_address', type: 'string' },
{ name: 'home_phone', type: 'string' },
{ name: 'postal_code', type: 'string' },
{ name: 'job_title', type: 'string' },
{ name: 'job_address', type: 'string' },
{ name: 'job_phone', type: 'string' },
{ name: 'mobile', type: 'string' },
{ name: 'fax', type: 'string' },
{ name: 'comment', type: 'string' }
],
validations: [
{type: 'presence', field: 'national_code'},
{type: 'presence', field: 'first_name'},
{type: 'presence', field: 'last_name'},
{type: 'presence', field: 'father_name'},
{type: 'length', field: 'first_name', min: 1, max:45},
{type: 'length', field: 'last_name', min: 1, max:45},
{type: 'length', field: 'father_name', min: 1 , max:45},
{type: 'inclusion', field: 'gender', list: ['Male', 'Female']},
{type: 'exclusion', field: 'username', list: ['Admin', 'Operator']}
]
});
var userstore = Ext.create('Ext.data.Store', {
id:'userstore',
model: 'User',
autoLoad: true,
autoSync: true,
proxy: {
type: 'ajax',
actionMethods: 'POST',
url : 'prepare.php',
reader : {type:'json',root:'users',successProperty: 'success'}
}
});
// Create the Grid
Ext.create('Ext.grid.Panel', {
store: userstore,
selType: 'rowmodel', // 'cellmodel'
loadMask: true,
plugins: [Ext.create('Ext.grid.plugin.RowEditing', {
clicksToEdit: 1,
errorSummary:true})
],
columns: [
{ dataIndex: 'national_code',
hideable: false,
header:'کدملّي',
align:'right' ,
editor : null
},{ dataIndex:'first_name',
text:'نام',
align:'right',
editor: {xtype:'textfield',allowBlank: false}
},{ dataIndex:'last_name',
text:'فاميل',
align:'right',
editor: {xtype:'textfield',allowBlank: false}
},{ dataIndex:'father_name',
text:'نام پدر',
align:'right',
editor: {xtype:'textfield',allowBlank: false}
},{ dataIndex:'sh_sh',
text:'شماره شناسنامه',
align:'right',
sortable:false,
editor: {xtype:'numberfield',allowBlank: false}
},{ dataIndex:'sh_s_sh',
text:'شماره سريال شناسنامه',
align:'right',
editor: {xtype:'textfield',allowBlank: false}
},{ dataIndex:'birth_date',
text:'تاريخ تولذ',
hidden:true,
editor: {xtype:'textfield',allowBlank: false}
},{ dataIndex:'birth_location',
text:'محل تولد',
hidden:true,
align:'right',
editor: {xtype:'textfield',allowBlank: false}
},{ dataIndex:'email',
text:'پست الکترونيک',
hidden:true,
align:'right',
editor: {xtype:'textfield',allowBlank: false}
},{ dataIndex:'home_address',
text:'آدرس منزل',
align:'right'
},{ dtatIndex:'home_phone',
text:'تلفن منزل',
align:'right'
},{ dataIndex:'postal_code',
text:'کد پستي',
align:'right',
},{ dataIndex:'job_title',
text:'شغل',
align:'right',
hidden:true
},{ dataIndex:'job_address',
text:'آدرس محل کار',
align:'right',
hidden:true
},{ dataIndex:'job_phone',
text:'تلفن محل کار',
align:'right',
},{ dataIndex:'mobile',
text:'تلفن همراه',
align:'right'
},{ dataIndex:'fax',
text:'فاکس',
align:'right'
},{ dataIndex:'comment',
text:'توضيحات',
align:'right',
hidden:true
}],
title: 'User List',
height:575,
width:1366,
renderTo: Ext.getBody()
});
});