I am displaying data for multiple machines in a single table. I would like to visually split the rows by machine by introducing a row that spans across all columns and has the machine name as the text. What are my options?
perfect…
spanHeaders = ['row','column','width','height']
spanData = []
rowIndex = 0
for wc in wcDs.getUnderlyingDataset().getColumnAsList(0):
ctl = {'type':'WC','data':wc}
data.append([system.util.jsonEncode(ctl),'','','','',''])
spanData.append([rowIndex,1,5,1])
rowIndex+=1
for i in range(0,3):
ctl2 = {'type':'DATA'}
data.append([system.util.jsonEncode(ctl2),'test1','test2','test3','test4','test5'])
rowIndex+=1
self.setCellSpanData(system.dataset.toDataSet(spanHeaders, spanData))
2 Likes
@cmisztur2 Thanks for sharing your code. Where did you find out that the method “getColumnAsList(0)” was available for “getUnderlyingDataset()”
Hmmm, good question. I thought maybe in the docs: ignition 7.9.4-beta1 API
but maybe I did a dir on the object to list attributes...
Most datasets you encounter in the designer or client are instances of a AbstractDataset, which extends the Dataset interface to include that method.
1 Like