Hi,
I am trying to apply a color to some cells in the JSGrid of the timesheet page.
I found a thread where someone did what i am trying to do:
<quote>
To change the style of the single cell try this
1. Register a style in javascript Init event
var dataSource = new SP.JsGrid.StaticDataSource(initialData);
var jsGridParams = dataSource.InitJsGridParams();
jsGridParams.styleManager.RegisterCellStyle('RedBackground', SP.JsGrid.Style.CreateStyle(SP.JsGrid.Style.Type.Cell, { backgroundColor: '#EF8284', foreColor: '#000000' }));
2. Assign the cell style to GridField
commentsGridField.DefaultCellStyleId = "RedBackground";
Hope this helps
-Sivaraman
</quote>
It looks like i can add the new style to the timesheetsatellite.js sharepoint javascript file.
But now, the only way i know of accessing records and fields is
var record = _satellite._tableCache.GetCachedRecord(eventArgs.newRecordKey);
OR
var array = new Array(1);
array[0] = eventArgs.newRecordKey;
_satellite._tableCache.GetRecordsByKey(array, function (arrayofKeys, arrayofRecords, bSucceeded){//do stuff here}
The arrayOfRecords contains the record that i am looking for, and inside the record is a property called 'properties' which has the cell data, but does not have the DefaultCellStyleID property.
Does anyone know where/how I can access the gridField/cell that contains DefaultCellStyleID?
Thanks