Quantcast
Channel: Project Customization and Programming forum
Viewing all articles
Browse latest Browse all 5347

How do i access a cell in the JSGrid and get access to DefaultCellStyleID?

$
0
0

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:

http://social.msdn.microsoft.com/Forums/uk-UA/project2010custprog/thread/6ea99385-130a-4793-874a-735126b3e0c4

<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









Viewing all articles
Browse latest Browse all 5347

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>