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

Lightswitch with Javascript controls

Hi,

I'm trying to use your Javascript controls in MS Lightswitch and I'm struggling.  I know Lightswitch well, but I'm a beginner at Javascript so I'm probably missing some simple steps.   Does anyone have some examples or a basic guide? 

Kind Regards,
John

3 Replies

LS Lingaraj S Syncfusion Team March 18, 2014 03:46 AM UTC

Hi John,

 

Regret for the delay,

 

Please find the sample from following location to use our JS control  in LightSwitch HTML Client application.

http://www.syncfusion.com/downloads/support/directtrac/119339/Application4509113360.zip

 

Please let me know if you have any concerns.

 

Regards,

Lingaraj S.



XV Xander van der Merwe March 21, 2014 02:39 AM UTC

The example project does not show how to actually bind the ejDatepicker to the contentItem and the rendering of the date picker field is also not looking quite right.

Here is a working example of rendering a datepicker for a "StockDate" column of type DateTime that was added to the example Products table:

myapp.AddEditProducts.StockDate_render = function (element, contentItem) {
    // add the data-role='none' to prevent jQueryMobile from messing with the control rendering
    var date = $("<input data-role='none' id='datepicker' type='text'/>");
    date.appendTo($(element));

    date.ejDatePicker({
        // set the control value to the contentitem value:
        "value": contentItem.value,
        change: function (args) {
            // update the content item when the value changes:
            contentItem.value = args.value;
        },
    });
};

ps. the online help documentation for the ejDatePicker control here http://help.syncfusion.com/js is incorrect. It states that the event to hook into for a new date being selected is the "dateSelected" event when it should in fact be the "change" event, similar to the ejDateTimePicker.


XV Xander van der Merwe March 21, 2014 04:14 AM UTC

Also see this LightSwitch forum thread where I showed an example of using the ejCheckBox as well:


Loader.
Live Chat Icon For mobile
Up arrow icon