So I think I found the issue I had with customs columns.
it looks like it does not work within a nested table but
only with the master table.
is this correct or did I miss somthing ?
here is my sample page
http://www.turningpointtech.com/sandbox/
I modified it to be as simple as possible, the logic to
create my custom columns is as follows
function PreProcessRowData(notificationType, notifier, data)
{
if (notificationType != “onPostLoad”)
return;
var rows = dsOption.getData();
// debugger;
for (var idx1 = 0; idx1 < rows.length; idx1++) // loop
the options
{
var row = rows[idx1]
row.testValue = “hello” + idx1;
for (var idx2 = 0; idx2 < row.machine.length; idx2++) //
loop the options
{
var colum = row.machine[idx2]
colum.statusc = ‘status c ‘ + idx2
row.statusr =’status set with row index’ + idx2;
}
}
}
in my final results I find testValue & the last row of
statusr but I don’t find statusc.
is this correct ?
if so then I could create an array within row to contain my
nested columns.
but what do I use as in index in the spry region ?
<div class=”TabbedPanelsContentGroup”>
<div spry:repeat=”dsOption”
class=”TabbedPanelsContent”>
<table width=”100%” border=”0″>
<tr>
<th width=”18%”>Machine</th>
<th width=”82%”>{dsOption::name}</th>
</tr>
<tr spry:repeat=”dsMachine” spry:even=”tableRow-even”
spry:odd=”tableRow-odd”>
<th>{dsMachine::machineName}</th>
<td><table width=”100%” border=”0″ cellspacing=”0″
cellpadding=”0″>
<tr>
<td width=”30%”><table width=”100%” border=”0″
cellspacing=”0″ cellpadding=”0″>
<tr>
<td width=”25%” spry:repeat=”dsValues” ><input
name=”{dsOption::id}{dsMachine::id}Radio”
type=”radio”
id=”{dsOption::id}{dsMachine::id}{dsValues::keyValue}Radio”
onChange=”radioValueChange(‘{dsOption::id}’,'{dsMachine::id}’,'{dsMac hine::name}’)”
value=”{dsValues::keyValue}” />
<label
for=”{dsOption::id}{dsMachine::id}{dsValues::keyValue}Radio”>{dsValue s::keyLabel}
</label>
</td>
</tr>
</table></td>
<td width=”5%” > </td>
<td width=”60%”
id=”{dsOption::id}{dsMachine::id}”>?pdated {testValue} {statusc}
{statusr}</td>
<td width=”5%” >{dsMachine::isvalue} </td>
</tr>
</table></td>
</tr>
</tr>
</table>
</div>
|||
No comments, ok let me rephrase the question.
within the spry:repeat is there some type of index I might
use with a custom column ?
like this {dsMachine::status(ds_RowNumber)}
so that in my postprocess I can do somthing like this
var rows = dsOption.getData();
var row = “”
for (var idx1 = 0; idx1 < rows.length; idx1++) // loop
the options
{
row = rows[idx1]
for (var idx2 = 0; idx2 < row.machine.length; idx2++) //
loop the options
{
if ( row.machine[idx2].csvalue == “” ||
row.machine[idx2].isvalue == “” ||
row.machine[idx2].csvalue != row.machine[idx2].isvalue) {
row.status[idx2] = ‘Pending’ }
else { row.status[idx2] = ‘Updated’ }
}
}
Related posts:
- Calculations while looping through dataset
- Nested spry:region and more.
- Menu Bar or Accordion using nested dataset
- spry:repeat display data in multiple rows/columns
- How to test Spry dataset values inside scripts?
Related posts brought to you by Yet Another Related Posts Plugin.