We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Retrieving datasource of a datamanger in javascript

Thread ID:





125097 Jul 20,2016 03:27 PM UTC Jul 21,2016 02:24 PM UTC JavaScript 1
Tags: ejDataManager
Lewis Hamill
Asked On July 20, 2016 03:27 PM UTC

I have defined the adaptor of the DataManager as JsonAdaptor in my markup and assigned the datasource in my code behind. I then want to retrieve that datasource from the DataManager in javascript.

How do I reference the DataManager in javascript and retrieve the datasource?

Sample code below:


<ej:DataManager ID="dmSuppliers" runat="server" Text="DataManager" Adaptor="JsonAdaptor" />


private void BindSupplierDataManager()
    var suppliers = new List<IdStringPair>()
        new IdStringPair(1, "Magenta"),
        new IdStringPair(2, "Trans"),
        new IdStringPair(3, "SuperSupplier")
    dmSuppliers.Json = suppliers;


function writeSupplierName(args) {
    var dropData = [
        //Retrieve datasource from datamanager
    var selIndex = [];
    if (args.rowdata != undefined) {
        for (j = 0; j < dropData.length; j++) {
            if (args.rowdata["SupplierName"] == dropData[j]) {
        width: "100%",
        dataSource: dropData,
        fields: { id: "text", text: "text", value: "value" },
        selectedItems: args.rowdata !== undefined ? selIndex : ""

Balaji M [Syncfusion]
Replied On July 21, 2016 02:24 PM UTC

Hi Lewis Hamill,


Thank you for contacting Syncfusion support.


You can retrieve the data from DataManager in done event which will be trigger while execute the query.


Please construct your ej.Query() to retrieve record and pass the query object to ej.Datamanager() .  You can access the DataManager by access the window object like  "window.{DataManager ID}". In done event will return data in e.result object.



<ej:DataManager ID="FlatData" runat="server" URL="http://mvc.syncfusion.com/Services/Northwnd.svc/" EnableCaching="true" CachingPageSize="10" TimeTillExpiration="120000" />



<script type="text/javascript">

        $(function () {


            var query = ej.Query().from("Orders").page(1, 10).sortBy("OrderID desc");

            var data = window.FlatData.executeQuery(query).done(function (e) {







Let us know if you have any queries.



M. Balaji


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon