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.

Action method is not receiving the parameter added in the ej-grid action-begin method

Thread ID:

Created:

Updated:

Platform:

Replies:

128631 Feb 1,2017 05:43 PM Feb 2,2017 11:27 PM ASP.NET Core 3
loading
Tags: Grid
dsapo
Asked On February 1, 2017 05:43 PM


Hi Support:

I defined the ej-grid as follows:

  <ej-grid id="grid" 
                     allow-paging="true"
                     template-refresh="refreshTemplate" action-complete="complete" action-begin="begin"  >
                   <e-datamanager url="/Home/DataSource" adaptor="UrlAdaptor"></e-datamanager>

                <e-columns>
               ....
                </e-columns>
           
            </ej-grid>


Then the script is:


 function begin(args)
        {
            args.model.query.addParams("age", 30);
      
        }

The DataSource action method is invoked but the age parameter is 0.

What could be missing here.

Thanks in advanced


David

Saravanan Arunachalam [Syncfusion]
Replied On February 2, 2017 08:07 AM

Hi David, 
Thanks for contacting Syncfusion’s support. 
The cause of the issue is you have recieved the additional parameters on the server side as a separate parameter and we suggest you to received both DataManager and additional parameter as a single object. Please refer to the below code example and screenshot. 
<ej-grid id="FlatGrid" allow-paging="true" action-begin="begin"> 
    <e-datamanager url="Home/DataSource" adaptor="UrlAdaptor"></e-datamanager> 
     . . . 
</ej-grid> 
<script type="text/javascript"> 
    function begin(args) { 
         
        args.model.query.addParams("age", 30); 
    } 
     
</script> 
public IActionResult DataSource([FromBody]Test dm) 
        { 
          . . . 
        } 
        public class Test :DataManager 
        { 
            public int age { get; set; } 
        } 
 
 
  
We have created a sample that can be downloaded from the below link. 
Regards, 
Saravanan A. 


dsapo
Replied On February 2, 2017 10:35 AM

Hi Saravanan:


Thanks for the precise answer as always.

Regards,

David 

Saravanan Arunachalam [Syncfusion]
Replied On February 2, 2017 11:27 PM

Hi David,  
Thanks for your update.            
We are happy that the provided information helped you. 
Regards, 
Saravanan A. 


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.

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.

;