args.model.data.addParams not work with WebMethodAdaptor

Hello,

I'm using WebMethodAdaptor to get Remote Data to grid. it's work.

except the function addParams is not work (it work finr at first when i use UrlAdaptor )

I can't use UrlAdaptor because of the problems with filter.


Here my code

//in Backend DataExplorer.aspx
[WebMethod]
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)] 
        public static object GetData(Syncfusion.JavaScript.DataManager value, int? employeeID)
        {
            return BindDataSource(value, employeeID); //just data access function
        }

//in UI
             
           
            
           
               .....
               .....


                 
What wrong with it? Please help.

Thanks in advance.

3 Replies

AS Adisorn Sirisomboon August 10, 2015 06:25 PM UTC

sorry the code are missing

======

< ej:Grid ID="Grid1" runat="server" AllowPaging="True" AllowFiltering="True" AllowSorting="True" MinWidth="0" AllowTextWrap="True" EnablePersistence="true" >

            < DataManager Adaptor="WebMethodAdaptor" URL="PromotionExplorer.aspx/GetData" / >
            < ClientSideEvents ActionBegin="actionbegin" / >
           
            < Columns >
                < ej:Column Template
                    ..................................
                    ..........

=========
< script type="text/javascript" >

        function actionbegin(args) {
            //if (args.requestType == "filtering" && args.currentFilterObject[0].operator == "startswith")
            //    args.currentFilterObject[0].operator = "contains";
            alert("requestType " + args.requestType);
            alert("model " + args.model);
            alert("model qry" + args.model.query);
            alert("model ds " + args.model.dataSource);
            alert("model qry ds " + args.model.query.dataSource);
           
            alert("model addParams" + this.model.query.addParams('employeeID', 1));

            alert("DataManager " + args.model.dataSource.DataManager);
           
            //args.requestType
            this.model.query.addParams("employeeID", 1);
            args.model.query.addParams("employeeID", 1);

            //this.model.data.addParams("employeeID", 1);
            //args.model.data.addParams("employeeID", 1);


            //args.model.query.addParams('employeeID', 1);
            //args.query.addParams('employeeID', 1);

            //var grid1 = document.getElementById('Grid1');
           
           
        }

    < /script >

Please help,


AS Adisorn Sirisomboon August 10, 2015 06:29 PM UTC

sorry again that is my test code
===

please see this instead

//in Backend DataExplorer.aspx
[WebMethod]
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)] 
        public static object GetData(Syncfusion.JavaScript.DataManager value, int? employeeID)
        {
            return BindDataSource(value, employeeID); //just data access function
        }

//in UI
< ej:Grid ID="Grid1" runat="server" AllowPaging="True" AllowFiltering="True" AllowSorting="True" MinWidth="0" AllowTextWrap="True" EnablePersistence="true" >
            < DataManager Adaptor="WebMethodAdaptor" URL="DataExplorer.aspx/GetData" / >
            < ClientSideEvents ActionBegin="actionbegin" / >
            < Columns >
                ....

// js
< script type="text/javascript" >
        function actionbegin(args) {
               args.model.query.addParams("employeeID", 1);
         }
< / script >


RU Ragavee U S Syncfusion Team August 11, 2015 09:28 AM UTC

Hi Adisorn,

We have analyzed the reported query and we have considered this query “addParams not working when using WebMethodAdaptor” as a bug and a support incident has been created under your account to track the status of this issue. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

Please get back to us if you need any further assistance.

Regards
Ragavee U S

Loader.
Up arrow icon