Hey guys,
working with Larry on this and in our Grid we put in the code above, but the refreshRow code does not seem to work.
$('#ourGridName').treegrid({
url:'com/Administration.cfc?method=getWhatWeNeed',
method:'get',
width:'97%',
idField:'id',
treeField:'col0',
emptyMsg: "No Records Found",
border: true,
fit: true,
singleSelect:true,
checkOnSelect: true,
fitColumns: true,
striped: true,
rownumbers: false,
collapsible: true,
lines: true,
onClickCell: function(field,row,index){
row['style'] = row['style']||{};
console.log(row);
console.log('row id: ' + row['id']);
console.log('row style field: ' + row['style'][field]);
alert(row['id']);
alert(row['style'][field]);
if (row['style'][field] == 'background:red;color:#fff'){
row['style'][field] = 'background:green;color:#fff';
} else if (row['style'][field] == 'background:green;color:#fff'){
row['style'][field] = 'background:red;color:#fff';
} else {
row['style'][field] = 'background:red;color:#fff';
}
alert(row['style'][field]);
$(this).treegrid('refreshRow',row['id'])
},
columns:[[ --- all our colum names and attributes below
The JSON that comes back from our external function is the same as what you have in the post, like:
var data = [
{ "id": 1, "name": "All Tasks", "begin": "3/4/2010", "end": "3/20/2010", "progress": 60, "iconCls": "icon-ok", "idField": 10 },
{ "idField": 11, "id": 2, "name": "Designing", "begin": "3/4/2010", "end": "3/10/2010", "progress": 100, "_parentId": 1, "state": "closed" }, and more..
MY QUESTION:
in the refreshRow line above, when we use row['id'] which is in the idField attribute, what is that ID Field and how does it work with the refreshRow code? we have an id field in our json code that returns.
That is my guess as to why our code is not working but your example code works....ANY THOUGHTS that could help us more forward would be awesome.
thanks
Dan
EasyUI