0

I'm trying to read data from my grid in project server 2013 and later in project online

So I customize my ribbon, and add a webpart on the page

If I add files with code which start with :

, it's working

But after some searches on internet, I need this code, but when I added in the webpart, it's not working

So have I something special to do to be able to use it?

for example the code comming from this link : https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2010/ff535984(v=office.14)

/// /// /// /// /// /// /// /// /// ///

/// /// ///

var pc; // Contains the Project Center extension object. var toggleMode; // Maintains state of the toggle button.

_spBodyOnLoadFunctionNames.push("ProjectCenterMain");

function ProjectCenterMain() { pc = new ProjectCenterExtension(); toggleMode = false; }

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. . .

}

What should I do to be able to use it?

Thank you for your help :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.