Get tablecache property of JsGrid on schedule.aspx page RRS feed

  • Question

  • Is there a way to get to the ._tableCache property of the ProjectDrillDownSatellite class in ProjectDrillDownSatellite.js?  I need to be able to get all of the selected records in the grid on schedule.aspx.  I have the satellite and I've used GetFocusedRecord to return the focused record, but this isn't sufficient.  I need to get every selected record.  I've tried using the GetSelectedRecordKeys function of the JsGridControl but this only returns the keys.  I need the actual record so that I can call the GetDataValue method of the record.  A snippet of my code is below:

    var satellite = projectDrilldownComponent.get_ProjectDrilldownSatellite();

    var record = satellite.GetFocusedRecord();


    The code above works perfectly.  However if I ever try to do the following, I get an undefined error:

    var data = satellite._tableCache;



    Wednesday, September 5, 2012 9:38 PM


  • Good question and only awailable using some Javascript hacks as the ProjectDrilldownSatellite does not follow the rules of the other satellites. Here is what we did:

              satellite = PJ._NotifySatelliteInitComplete.arguments[0];
              getTableCache: function (satellite) {
                    /// <summary>
                    ///    To be able to retrieve data (e.g. the current record) we need to get hold of the tableCache. As this does
                    ///    not work in the documented way for the ProjectDrilldownSatellite, an alternative manner using the callstack
                    ///    is provided if the 'regular' way does not work.
                    /// </summary>
                    /// <param name="satellite" type="Object">
                    ///     The satellite of the grid.
                    /// </param>
                    /// <returns type="Object" />
                    if (satellite._tableCache != undefined) {
                        return satellite._tableCache;
                    else {
                        return PJ._NotifySatelliteInitComplete.arguments.callee.arguments.caller[0].tableCache;
    Notice - this is most likely not supported by Microsoft. Therefore wrap up the hacks in functions (like above) and recheck with future releases. That this gets fixed in a SP is very unlikely, as this would require some substantial rewrites.

    Jan Cirpka

    Thursday, September 6, 2012 6:57 AM