PDA

View Full Version : How to hide fields in source data in PropertyGrid



sachin sachdeva
12 Jan 2011, 12:28 AM
Hello sir i have certain fields which i do not want to show to user but i am using source to populate my grid .Here is the code that i am using


var dataRow = grid.getSelectionModel().getSelected();
source = "{" + "\"Size\":\" " + dataRow.data.size + "\"," + ""
+ "\"Author\":\"" + dataRow.data.author + "\"," + ""-----WANT TO HIDE THIS FIELD
+ "\"File Name\":\"" + dataRow.data.fileName + "\" ,"
+ "" + "\"Title\":\"" + dataRow.data.title + "\" ,"
"}"
GeneralpropsGrid.setSource(eval('(' + source + ')'));



i am using json data so is it possible ...plz let me know
CODE FOR GENERAL PROPERTIES





GeneralpropsGrid = new Ext.grid.PropertyGrid(
{
title : 'General Properties',
isEditable : true,

loadMask : {
hideOnReady : false
},
listeners : {
beforeedit : function( rowIndex, grid) {
return this.checkIfEditable(rowIndex.record.id);
}
},
checkIfEditable : function(
field) {
if (field == 'Title')
return true;
else if (field == 'Tags')
return true;

else if (field == 'Comments')
return true;

else if (field == 'Expiration Date')
return true;

else if (field == 'Content Category')
return true;
else if (field == 'Searchable')
return true;

else {
return false;
}
},
customEditors : {

'Expiration Date' : new
Ext.grid.GridEditor(new
Ext.form.DateField( {
format : 'm/d/Y',
name :'expiryDate',
id :'expiryDate',

region : 'center',
editable : false,
minValue : (new Date())
.clearTime(),
releaseDateField :
'Release Date',
allowBlank : true })),

'Searchable' : new Ext.grid.GridEditor(new Ext.form.ComboBox(
{
typeAhead : true,
editable : false,
triggerAction : 'all',
store : searchableStore,
lazyRender : true
})),

'Content Category' : new Ext.grid.GridEditor(new Ext.form.ComboBox(
{
typeAhead : true,
editable : false,
triggerAction : 'all',
store : contentCategoryStore,
lazyRender : true
}))


},
...
....