Hi,
ASP.net webforms DP scheduler - trying to implement row double-click functionality. Just testing at the moment but am getting an “unexpected token ‘$’, “$$$System.”… is not valid JSON” error.
Markup:
RowClickHandling="Callback"
OnRowClick="dpsAcView_RowDoubleClick"
code-behind:
Protected Sub dpsAcView_RowDoubleClick(sender As Object, e As RowClickEventArgs)
Dim resourceId As String = e.Resource.Id
Dim resourceName As String = e.Resource.Name
Dim alertText As String = resourceId & " " & resourceName
dpsAcView.UpdateWithMessage(alertText)
End Sub
From a context menu on the same row (set up to pop a js alert box) I am getting the id and name values. If I set up another context menu (“test” in this example) and call a js function that does commandCallBack I can pass the row id to the “command” sub in the code-behind and use it (for test purposes I was displaying it using “.UpdateWithMessage”:
Markup:
<DayPilot:MenuItem Action="JavaScript" JavaScript="resourceCommand(e.value)" Text="test" />
js:
function resourceCommand(resourceId) {
dpsAcView.commandCallBack("test", { id: resourceId });
}
c-b:
Protected Sub dpsAcView_Command(sender As Object, e As CommandEventArgs)
select case e.Command
…
case “test”
Dim resourceId As String = CStr(e.Data("id"))
dpsAcView.UpdateWithMessage(resourceId)
…
However, no combination of code seems to work for clicking or double-clicking a resource row, client-side or server-side. If I change the handling to Javascript I get an “args not defined” or similar error:
Markup:
RowClickHandling="Javascript"
RowClickJavaScript="onRowDoubleClick(e.value())"
js:
function onRowDoubleClick(rowId) {
alert("Double-clicked resource row: " + rowId);
}
Error: e is not defined (it throws an “args not defined” if I replace e.value() with anything that has “args” in it).
Any ideas? Thanks - EW