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. Image for the cookie policy date
close icon

Using the JavaScript controls with MS Lightswitch

Hi,

I'm looking for some guidence to use the JavaScript controls in Lightswitch. Specificly the changes needed to the default.htm, how best to include the assets folder into a project (and what is the minimum needed), how to attach event handers and finally two way binding. 

Thanks,
John
P.S. I also posted the question on the lightswitch forum here.

3 Replies

HP Harikrishnan P Syncfusion Team March 13, 2014 02:17 PM UTC

Hi John,

Currently we do not have official support for using JS framework in Lightswitch Environment. We will provide official support for using JS framework in Lightswitch in any of our upcoming release.

Please be patience until then.

Query1: how best to include the assets folder into a project (and what is the minimum needed)

Answer: Minimum files needed from the folders present inside the assets folder.

1)      CSS – ej.widgets.core.css and ej.theme.css file present in the default-theme folder applies the default theme for the JS contols. If you need other themes, you can use the ej.widgets.core.css and ej.theme.css files from the corresponding gradient or flat themes folders. The common-images folder (css -> web -> common-images) is necessary as we refer the icons needed for our JS controls.

2)      External – JQuery 1.10.2.min is and Jquery.easing-1.3.min file are needed. Other files that needs to be included is based on your requirement.

3)      Scripts – ej.widgets.all.min file includes the scripts of all JS controls. So this file alone can be included.

Query2: how to attach event handers

Answer: Event handler for our controls can be used like below,

For example to use the click event handler of our button control code as below,


          

           //create event for button

            $("#button1").ejButton({

                create: function (args) {

 // args.cancel   - returns the cancel option value

              // args.model    - returns the button model

              // args.type     - returns the name of the event

                         //handle the event

}

});       

 

Query3: two way binding

Answer: At present we have not provided two way binding support of Knockout JS. We have planned to provide this feature in our upcoming release.

Kindly get back to us if you have further queries.


Regards/Thanks,

HariKrishnan.



JB John Burgin March 21, 2014 08:59 AM UTC

Hi,

Thanks for the reply.  I'll give the code a try.

An official Lightswitch version is very interesting! 

Thanks, 
John


HP Harikrishnan P Syncfusion Team March 24, 2014 06:09 AM UTC

Hi John,

We will update you, once we provide an official support for our JS controls in Lightswitch.

We appreciate your patience until then.

Please let us know if you have further queries.

Regards,

HariKrishnan.


Loader.
Live Chat Icon For mobile
Up arrow icon