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

Accessing the JS Grid for Project Server 2013 Preview

$
0
0

I'm testing Project Server 2013 Preview and am wondering, how can I access JS Grid instances in PWA from a WebPart or something else on client-side using ECMAScript (JavaScript). I need to attach event handlers (e.g. for OnRowFocusChanged).

There was an example in a walkthrough For Project Server2010. With using PJ.AddGridSatelliteInitializationNotifier and PJ.ProjectCenterSatellite (for Project Center JS Grid):

function ProjectCenterExtension() {var _grid;          // Display surface (a view) of the JS Grid.var _satellite;     // Control wrapper for the JS Grid.// Prevent ECMAScript errors if PJ or the AddGridSatellite function are not defined.// If the page is from Project Server, the PJ namespace is defined.// If the Project page includes JS Grid, the AddGridSatelliteInitializationNotifier // function is defined.if (window.PJ == null || PJ.AddGridSatelliteInitializationNotifier == null) {return;
    }// Use the PJ.AddGridSatelliteInitializationNotifier function to get an instance // of the satellite.
    PJ.AddGridSatelliteInitializationNotifier
    (function (satellite) {if (PJ.ProjectCenterSatellite != null) {/*** Satellite override: Project code should pass in "satellite" instead of "this". ***/
                satellite = PJ._NotifySatelliteInitComplete.arguments[0];
                _satellite = satellite;/***End Satellite override***/

                _grid = satellite.GetJsGridControlInstance();
                _grid.AttachEvent(SP.JsGrid.EventType.OnRowFocusChanged, RowChanged);
            }
        }
    );
    // Other functions. . .
}

But this approach doesn't work anymore for PS2013 Preview. PJ.ProjectCenterSatellite does not exist, as well as any other previous JS Grid sattelites (on other PWA pages) I've seen in PS2010 (e.g. for Timesheet, etc).

Can someone give me a direction or point in the documentation where to look for the new behavior?

Thanks in advance!

UDPATE: PJ.AddGridSatelliteInitializationNotifier DOES exist, and sucesfully appends a notifier, BUT it is never called! It seems that JS Grid is never initialized, or it is initialized in a quite different way.

OR Project Center doesn't use JS Grid at all and some other component is used... Then the question is - how to access and use it?




Viewing all articles
Browse latest Browse all 5347

Trending Articles



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