Widget Webrequest

0
0

Hi,

 

i have tried to integrate a 3rd party javascript library and use the widget control, the 3rd party control sends data using POST with data as follows:

{“url”:”postback.wx?sid=1qbm5ll3qcfe2xe3ch5fejpa&x=ewAiAGkAZAAiADoAIgBpAGQAXwAzADkAIgB9AA==/Post”,”method”:”POST”,”data”:{“values”:”{\”STARTDATE\”:\”2020-06-18T08:00:00.000\”,\”ENDDATE\”:\”2020-06-18T08:30:00.000\”,\”AllDay\”:false,\”description\”:\”test2\”,\”SUBJECT\”:\”test\”}”},”dataType”:”text”}

 

In webrequest event of that widget, I cannot see where are the values of data: went? I cannot see it anymore.

 

Hope you can help me on this.

 

Thanks.

 

  • Glenn Gonzales
    in web request, the method is always “GET”, how can I change it to “POST”? Is that possible?
  • Glenn Gonzales
    Please take note I am using a usercontrol and on it is widget.
  • You must to post comments
0
0

Hi Glenn,

Check out the updated attached sample. Widget_WebRequest is hit twice in your sample.

  1. When you are requesting data to populate the scheduler
  2. When you insert a new record

e.Request.Form is populated in the second scenario, it contains the new record.

Let me know if you have any questions about it.

BTW, we also offer the DevExpress DevExtreme control set (as a wrapped C# object, so you don’t have to touch JS) as a premium extension for Technology Partners if you’re interested. Just one of the many cool perks!

 

Best,

Levie

  • Levie (ITG)
    Here is a link on the information: https://wisej.com/technology-partner/, you can also send an email to sales AT wisej.com to get started! Best, Levie
  • Glenn Gonzales
    Hi, I am not sure what did I miss, when I call widget.eval(“this.cal.refresh()”); it would give me an error saying refresh is not a function, this.cal is assigned in init of widget as follows this.cal = $(this.container).data(“dxScheduler”); Thanks.
  • Luca (ITG)
    $(this.container).data(“dxScheduler”); doesn’t create the dx scheduler, it returns an instance of an already created scheduler. You have to follow the DevExpress syntax: https://js.devexpress.com/Demos/WidgetsGallery/Demo/Scheduler/Overview/jQuery/Light/
  • Glenn Gonzales
    Hi, Here is the complete code: $(this.container).dxScheduler({ dataSource: wisej.web.DesignMode ? null : DevExpress.data.AspNet.createStore({ key: “ID”, loadUrl: url + “&action=load”, insertUrl: url + “&action=insert”, onUpdating :function(data){ console.log(data); } , onInserting :function(data) { console.log(data); }, onBeforeSend :function(operation, ajaxSettings) { if(operation==”insert”) { //alert(JSON. stringify(ajaxSettings)); } } }) , showBorders: true, width:”100%”, views: [“day”, “workWeek”, “month”], remoteFiltering: true, currentView: “day”, startDayHour: 6, endDayHour: 18, textExpr:”SUBJECT”, startDateExpr: “STARTDATE”, endDateExpr:”ENDDATE”, allDayExpr : “AllDay” }); this.cal = $(this.container).data(“dxScheduler”); =================================================== Please take note, that it is running and I can interact with the scheduler, only when I want to manually refresh from a button click, by calling widget.eval(“this.cal.refresh();”); <==== this is the line the raised an error. Thanks.
  • Glenn Gonzales
    In a datagrid, I can call any function of the dx datagrid using widget.eval(“this.grid.xxxx”), I am just following the examples from your integration 1, Thanks.
0
0

Please see attached sample project, please take note, in webrequest event, e.Request.Form always zero length list/array.

 

Thanks.

  • Glenn Gonzales
    I have set the breakpoint at webrequest event where I assigned the e.Request.Form to a variable.
  • You must to post comments
0
0

Hi Glenn,

You received the data in the Widget_WebRequest handler?

You can find the POST data in e.Request.Form.

You can access the GET parameters with e.Request.QueryString.

 

If you attach a small sample I can help you look at it further!

Best regards,

Levie

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.