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.
Unfortunately, activation email could not send to your email. Please try again.

ejmgrid/ejgrid in lightswitch HTML

Thread ID:

Created:

Updated:

Platform:

Replies:

117167 Aug 27,2014 05:16 AM Aug 28,2014 05:36 PM JavaScript 2
loading
Tags: ejGrid
MEHOU
Asked On August 27, 2014 05:16 AM

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

Ragavee U S [Syncfusion]
Replied On August 28, 2014 03:09 AM

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


Héctor Reyes
Replied On August 28, 2014 05:36 PM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;