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

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

  • mercredi 25 juillet 2012 13:25
     
     

    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








    • Modifié 5OP-50 mercredi 25 juillet 2012 15:07
    • Modifié 5OP-50 mercredi 25 juillet 2012 19:47
    • Modifié 5OP-50 mercredi 25 juillet 2012 19:48
    • Modifié 5OP-50 dimanche 29 juillet 2012 18:03
    • Modifié 5OP-50 dimanche 29 juillet 2012 18:03
    • Modifié 5OP-50 dimanche 29 juillet 2012 18:03
    • Modifié 5OP-50 dimanche 29 juillet 2012 18:03
    •