none
Problem with PJ.AddGridSatelliteInitializationNotifier on Project Server 2013 RRS feed

  • Question

  • Hi everybody, I have the following problem I have the following code running in Project Server 2010 to make some modifications to the timesheet grid, and is working well, but now this same code in Project Server 2013, does not work and do not know why this is happening. 

    $("document").ready(function () { Sys.WebForms.PageRequestManager.getInstance().add_endRequest(End); function End(sender, args) { } // Add the onApplicationLoad handler to the Sys.Application.load event. Sys.Application.add_load(TimesheetExtensionMain) }); function TimesheetExtensionMain() { // init extender object timesheetExtender = new TimesheetExtender(); } function TimesheetExtender() { var _grid; var _satellite; if (window.PJ == null || PJ.AddGridSatelliteInitializationNotifier == null) { return; } PJ.AddGridSatelliteInitializationNotifier ( function (satellite) { try { if (PJ.TimesheetSatellite != null) { satellite = PJ._NotifySatelliteInitComplete.arguments[0]; _satellite = satellite;

    _grid = satellite.GetJsGridControlInstance(); _grid.AttachEvent(SP.JsGrid.EventType.OnPropertyChanged, OnPropertyChanged); _grid.SetDelegate(SP.JsGrid.DelegateType.GetGridRowStyleId, GetGridRowStyleId); } ); }

    I think the next section or simply never executed was not modified, anyone can help me.

    PJ.AddGridSatelliteInitializationNotifier ( function (satellite) { try { if (PJ.TimesheetSatellite != null) { satellite = PJ._NotifySatelliteInitComplete.arguments[0]; _satellite = satellite; _grid = satellite.GetJsGridControlInstance(); _grid.AttachEvent(SP.JsGrid.EventType.OnPropertyChanged, OnPropertyChanged); _grid.SetDelegate(SP.JsGrid.DelegateType.GetGridRowStyleId, GetGridRowStyleId); }

    );

    Or is there some other way to retrieve information from the TSG and modify?

    Thanks.


    .Net Developer and SharePoint programmer




    Monday, October 21, 2013 8:52 PM

All replies

  • Hi everyone thanks for Microsoft help, this maybe the solution about my problem, but all right, I hope this somebody helps.

    $("document").ready(function () {
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(End);
        function End(sender, args) { }
        Sys.Application.add_load(MyMain);
    });
    
    function MyMain() {
    
        SP.SOD.executeOrDelayUntilScriptLoaded(function () {
            
            JsApi.ExtensibilityManager.AddListener("PJ", function (api, isInited){
                    if(isInited == true && api.get_ApiType() == 44)
                    {
                        API_TSG = api.get_impl();
                        gridControl = api.get_impl()._jsGridControl;
                        
                        gridControl.AttachEvent(SP.JsGrid.EventType.OnPropertyChanged, OnPropertyChanged);
                        gridControl.SetDelegate(SP.JsGrid.DelegateType.GetGridRowStyleId, GetGridRowStyleId);
                    }
                });
        }, "sp.ribbon.js");
    }

    My other problem now is in my 2010 version I some styles and labels of Timesheet Gird cells, but as this function executes after the ribbon is load, it not refresh the page, somebody have any idea of how I can do that?, and also  when the " GetGridRowStyleId" is execute it can't give the grid cells.

    Thanks all.


    .Net Developer and SharePoint programmer

    Tuesday, October 29, 2013 2:46 PM