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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Send parameter - JS grid

Thread ID:

Created:

Updated:

Platform:

Replies:

132473 Sep 4,2017 03:11 PM UTC Sep 6,2017 05:39 PM UTC JavaScript 1
loading
Tags: ejGrid
noName
Asked On September 4, 2017 03:11 PM UTC

I am trying to send parameter when request data for the grid:

$("#Grid").ejGrid({
dataSource: dm,
allowScrolling: true,
allowVirtualScrolling: true,
filterSettings: {
filterType: "menu"
},
query: new ej.Query().addParams("id", 23),
allowFiltering: true,
scrollSettings: { width: "auto", height: 300, allowVirtualScrolling: true, virtualScrollMode: ej.Grid.VirtualScrollMode.Continuous },
pageSettings: { enableQueryString: true, pageSize: 10 },
columns: [
{ field: "data", headerText: "Data", isPrimarykey: true },
{ field: "value", headerText: "Value" },
]
});
and the action:
public JsonResult Get([FromBody]DataManager dm, [FromBody]string id)
{...
, I see the request with id 23 is send to the server, but when I debug on the server id is null.
You can see in the sample.

Attachment: SyncfusionASPNETCoreWebApplication1_3556037a.rar

Thavasianand Sankaranarayanan [Syncfusion]
Replied On September 6, 2017 05:39 PM UTC

Hi Sir, 

Thanks for contacting Syncfusion support. 

We have analyzed your query and we are able to reproduce the reported issue from the provided sample. 

We have already discuss about the above mention query in the following Knowledge base. 


Refer the below code example. 

[Site.js] 

$("#Grid").ejGrid({ 
    dataSource: dm, 
    allowScrolling: true, 
 
     --- 
 
    pageSettings: { enableQueryString: true, pageSize: 10 }, 
    columns: [ 
        { field: "value", headerText: "ID", isPrimarykey: true }, 
        { field: "data", headerText: "Email" }, 
    ], 
 
    actionBegin: function (args) { 
 
        args.model.query.addParams("ID", 10248); 
    } 
 
}); 
 
---------------------------------------------- 
[HomeContrller.cs] 

        public class Test : DataManager       //inherit the class to show age as property of DataManager 
        { 
            public int ID { get; set; } 
        } 
        public IActionResult Get([FromBody]Test dm) 
        { 
            var data = new[] 
                { 
                     
                  --- 
 
                }; 
 
            IEnumerable Data = data.ToList(); 
            DataOperations operation = new DataOperations(); 
             
             --- 
 
            return Json(new { result = Data, count = count }); 
        } 


Refer the below screenshot. 

 

We have modified the sample and it can be downloadable from the below location. 


Refer the help documentation. 


Regards, 
Thavasianand S. 


CONFIRMATION

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.

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

;