Forum Replies Created
-
Author
-
Thank you Dimitar. You made my day. I am also trying to group the contacts based on groupName. I would like to have inline edit option to the group name but not for the contacts that are listed under the group names. How can I do it?
var manageGroupSource =
{
datafields: [
{name: ‘groupid’},
{name: ‘groupName’},
{name: ‘firstName’},
{name: ‘lastName’},
{name: ‘contactid’}
],
hierarchy:
{
groupingDataFields:
[
{
name: “groupName”
]
},
root: “entry”,
record: “content”,
id: { name: “Contactid”},
localdata: manageGroupsData,
datatype: “array”,$(“#managegroupgrid”).jqxTreeGrid(
{
width: 350,
height: 250,
source: manageGroupsdataAdapter,
sortable: false,
columnsResize:true,
altRows: true,
editable:true,columns: [
{datafield: ‘firstName’, editable:false, width:100, height: 20},
{datafield: ‘lastName’, editable:false, width: 100, height: 20}]
If i use this code, I am not able to edit the group name. I just want to edit only group name.
Thanks
Thank you Dimitar. Everything is working fine now. But I still have some problem with loading data into tree grid. I am using the sameway that I use for JQXGrids. Is it the right method for Treegrid. If I do this way, I am getting following error.
Cannot read property ‘datafields’ of undefined datatable.js
Here is my code.
manageGroupsData.push(manageGroupData)
}
}
var newSource =
{
localdata: manageGroupsData,
datatype: “array”
};
$(“#managegroupgrid”).jqxTreeGrid({
source: newSource
});
manageGroupsData= new Array();
var manageGroupSource =
{
datafields: [
{name: ‘groupid’},
{name: ‘groupName’},
{name: ‘firstName’},
{name: ‘lastName’},
{name: ‘contactid’}
],
hierarchy:
{
keyDataField: { name: ‘groupid’ },
parentDataField: { name: ‘contactid’ }
},
id: ‘groupid’,
localdata:manageGroupsData,
datatype: “array”
};manageGroupsdataAdapter = new $.jqx.dataAdapter(manageGroupSource)
$(“#managegroupgrid”).jqxTreeGrid(
{
width: ‘100%’,
height: ‘100%’,//showheader: true,
source: manageGroupsdataAdapter,
//enablemousewheel: true,
//showsortmenuitems: false,
//enablehover: false,
sortable: false,
// showtoolbar: false,
// selectionmode: ‘none’,
// pageable: true,
// rowsheight: 20,
// groupable:true,
columnsResize:true,
// altrows: true,columns: [
{datafield: ‘firstName’, editable:true, width: 181, height: 20},
{datafield: ‘lastName’, editable:true, width: 181, height: 20}
// {datafield: ‘groupName’, width: 181, height: 20}]
});Thanks
Thanks for the help
-
AuthorPosts