Hi,
I have a datagrid with groupview and all works fine after data loading.
As long as I am in the function groupFormatter in the datagrid, I can set the group header to whatever I want.
But what I need is that I can also update the group headers dynamically outside of the groupFormatter function,
after user has changed elements in the datagrid. F.e. user can change html slider element in the datagrid
and I want to reflect the changes in the group header without saving and reloading the data from server every time.
i.e. my problem is that in the groupFormatter I can simple return the value for the group header and it gets set,
but if I call such a function later on, I need to manually get the panel or element or whatever of the relevant group header to set it.
What is the correct way to get (and set) each group view header title dynamically (w/o simply reload)? For title/panel of the datagrid this works well, see below, so I need something similar for each group header.
// -------------------------------------------
// statistic for the panel on top
// -------------------------------------------
var nCount = 0;
var nSumWert = 0.0;
var rows = $('#dg_skills').datagrid('getRows');
for(var j=0; j<rows.length; j++)
{
var act_amount = parseFloat(document.getElementById('mySlider'+j).value);
if ( act_amount > 0 )
{
nCount++;
nSumWert += act_amount;
}
}
var strTitle = 'Mitarbeiter: ['+ (document.getElementById('NAME').value).toUpperCase() +'] hat ' + nCount + ' Skills mit ' + nSumWert + '/' + (rows.length*3) + ' Punkten (=' + (nSumWert/(rows.length*3)*100).toFixed(2) + '%)';
var p = $('#dg_skills').datagrid('getPanel');
p.panel('setTitle', strTitle);
Thank you very much!
BR Mike.