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

ejmgrid/ejgrid in lightswitch HTML

I am evaluating ejmGrid. I would like to have a sample or tutorial about how to use ejmgrid or ejgrid in lightswitch HTML

2 Replies

RU Ragavee U S Syncfusion Team August 28, 2014 07:09 AM UTC

Hi Mehou

 

We regret for the inconvenience caused.

 

Query:I would like to have a sample or tutorial about how to use ejmgrid or ejgrid in lightswitch HTML

EjmGrid:

Currently, ejmGrid is not provided with light switch support.

EJGrid:

Currently, we have not provided the support for rendering our controls in LightSwitch HTML. We have tried to render our control within the LightSwitch, but we have known issue like css overriding , script loading issues and also it prevents our script files being executed and its css will override our control .

So we have logged a feature request “Essential JS in LightSwitch” for both ejmGrid and ejGrid; it will be available in our Volume 3, 2014 release. We will let you know once the feature is implemented.

Please get back to us if you have any further queries.

 

Regards

Ragavee U S



HR Héctor Reyes August 28, 2014 09:36 PM UTC

Hi

You need create an ajax

myapp.BrowsePersonSet.ejGridSyncfusion_render = function (element, contentItem) {
    var url = "../ejGrid/ejGrid/0";
    var dataManager = null;
    $.ajax({
        async: false,
        url: url,
        dataType: "json",
        success: function (data) {
            dataManager = data;
        }
    });

    $(element).append("<div id='Grid'></div>");

    $("#Grid").ejGrid({
        dataSource: dataManager,        
        allowPaging: true,
        allowSorting: true,
        columns: [
                { field: "Name", headerText: "Person", width: 75, textAlign: ej.TextAlign.Right },
                { field: "Phone", headerText: "Phone", width: 80 },
                { field: "Email", headerText: "Email", width: 80 },
                { field: "City", headerText: "City", width: 75, textAlign: ej.TextAlign.Right },
        ]
    });
};

And Controller

public class ejGridController : ApiController
    {
        public object Get(int someValue)
        {
            using (ServerApplicationContext context = ServerApplicationContext.CreateContext())
            {
                var query = context.DataWorkspace.ApplicationData.
                    QueryPerson(someValue).OrderBy(u=>u.Name);
                var result = query.Execute().Select(d => new { 
                    Name=d.Name,
                    Email =d.Email,
                    Phone =d.Phone,
                    City=d.City
                }).ToArray();

                return result;
            }
        }
    }

Attachment: ejGrid_73ffa434.zip

Loader.
Live Chat Icon For mobile
Up arrow icon