How to control Syncfusion Essential JS 2 Controls with more detail?

Answered
1
1

Hello,

 

I’m trying to build a WiseJ Page with the EJ2 Kanban Board. This one: https://ej2.syncfusion.com/documentation/kanban/

 

Through looking how exactly the examples work, I know I can use the C# Options field to give data and settings to the JS Control. It’s filled from Data from the database.

 

So now I want to implement Updates and Deletes. The easiest and best ways would we either 1. have WiseJ-Buttons in the card. But it seems I can only change the appearance of cards through CSS. Or 2. react on the Double Click on a Card. On C# side I can only do something like this.kanban1.MouseDoubleClick += … but the arguments are the standard C# Event args and don’t give me the Card like the Javascript Events do: https://ej2.syncfusion.com/demos/#/bootstrap5/kanban/events.html

function OnCardDoubleClick(args: CardClickEventArgs): void {
   appendElement('Kanban - ' + (args.data as { [key: string]: Object }).Id + ' - <b>Card Double Click</b> event called<hr>');
}

Of course I also need to react on Drag and Drop and Update the state of tasks in the database.

What’s the most elegant way to implement these Updates/Deletes? I think I can’t write something in the C# Options field to get cardDoubleClick: OnCardDoubleClick in JS. It seems I need to hack me into the Javascript settings to subscribe to the Javascript event and run a WiseJ function from there. This seems a bit unreasonable for a Control that WiseJ is supporting. And  the WiseJ documentation for the premium Controls seems to be lacking.

Edit: Adding more info:

– I know EJ2 allows to add custom dialogs, but I would need to define them in html. I already have the Form in WiseJ that I want to use.

– I know you can define Datamanagers in EJ2 Javascript. But I would rather just use my C# Code.

  • You must to post comments
Best Answer
1
1

Hi Sascha,

Earlier this year we introduced the Wisej DemoBrowser application that showcases different demos for all controls that Wisej.NET has to offer.

In that regard, the DemoBrowser also includes all the Premium extensions and that includes EJ2 Controls .

The source code is open source too, so you can check how everything works in the background.

All premium extension controls expose the Instance parameter, so you can attach to any javascript event and route it to the server, as an example you can do something like this.kanban1.Instance.onCardDoubleClick += new WidgetEventHandler(my_event_method);

That way you can stick to writing C# code rather than having to deal with Javascript client-side code, but you can always do that too!

HTH,
Alaa

//

  • Sascha Lorenz
    Ah, I was aware of the demos and source code, but I must have missed the part with the WidgetEventHandler. Thanks!
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.