Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1930
Sorting dinamically error : unable to get the property 'show': object is null or undefined
posted

Hi

i'm using iggrid in my mvc razor application and it works great, but there is a problem when try to sort a column dinamically and i get error.

This is the error i get : Microsoft JScript runtime error : unable to get the property 'show': object is null or undefined. In file ig.grid.ui.min.js the.

(i've attacched a picture to show the error)

This is how i try to sort the column dinamically:


$(document).delegate("#gridVistaArticoli", "iggriddatarendered", function (evt, ui){

     $('#gridVistaArticoli').igGridSorting('sortColumn', 1, 'ascending'); 

     or

     $('#gridVistaArticoli').igGridSorting('sortColumn', 'StagioneCodice', 'asc'); 

     $('#gridVistaArticoli').igGridSelection('selectRow', 5);    //This works fine

});

This is how igGrid look like :

@(Html.Infragistics().Grid<InfoCopy.SuiteInBlu.SuiteArticoliServiceReference.VistaArticoli>()

    .ID("gridVistaArticoli")

    .AutoGenerateColumns(false)

    .AutoGenerateLayouts(false)

    .Columns(column =>

        {

            column.For(x => x.Codice).DataType("string").HeaderText("Codice").Width("8%");

            column.For(x => x.ColoreCodice).DataType("string").HeaderText("Colore").Width("5%");

            column.For(x => x.StagioneCodice).DataType("number").HeaderText("Stagione").Width("6%");

            column.For(x => x.CampionarioCodice).DataType("string").HeaderText("Campionario").Width("9%");

            column.For(x => x.Descrizione).DataType("string").HeaderText("Descrizione").Width("27%");

            column.For(x => x.DittaCodice).DataType("string").HeaderText("Ditta").Width("5%");

            column.For(x => x.LineaCodice).DataType("string").HeaderText("Linea").Width("5%");

            column.For(x => x.MaterialeCodice).DataType("string").HeaderText("Materiale").Width("6%");

            column.For(x => x.Cod_Variante).DataType("string").HeaderText("Variante").Width("10%");

            column.For(x => x.Barcode).DataType("string").HeaderText("Codice a Barre").Width("9%");

            column.For(x => x.PathImg).HeaderText("Immagine").Template(ImageTemplate).Width("7%");

            column.For(x => x.ID_Articolo).DataType("number").HeaderText("ID").Width("10%");

        })

    .Features(features =>

        {

            features.GroupBy().GroupBy.EmptyGroupByAreaContent = "Drop column here to group";

            features.Paging().PageSize(Model.gridPageSize)

                .PrevPageLabelText("Previous")

                .NextPageLabelText("Next")

                .PageSizeDropDownTooltip("Select page")

                .ShowPageSizeDropDown(false)

                .CurrentPageIndex(@Model.GridPageIndex);

            features.Sorting().Mode(SortingMode.Single).ColumnSettings(settings =>

            {

                settings.ColumnSetting().AllowSorting(true);

            });

            features.Filtering();

            features.Resizing().AllowDoubleClickToResize(true).DeferredResizing(true).ColumnSettings( s=>

            {

                s.ColumnSetting().ColumnKey("PathImg").AllowResizing(false);

            });

            features.Selection().MouseDragSelect(true).MultipleSelection(true).Mode(SelectionMode.Row);

        })

            .ClientDataSourceType(ClientDataSourceType.JSON)

            .DataSourceUrl(Url.Action("GetVistaArticoli"))

            .Width("100%")

            .LocalSchemaTransform(true)

            .DataBind()

            .Render()

    )

 

Parents
No Data
Reply
  • 24671
    Suggested Answer
    posted

    Hi,

    could you use the "iggridrendered" event instead of the "iggriddatarendered" ? the loading indicator is common to the whole grid so it may not be loaded once iggriddatarendered fires. 

    Thanks,

    Angel

Children
No Data