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.

Filtering grid

Thread ID:

Created:

Updated:

Platform:

Replies:

119346 Jun 8,2015 02:43 PM Jun 10,2015 08:47 AM LightSwitch HTML 1
loading
Tags: Grid
Artur Barth
Asked On June 8, 2015 02:43 PM

After applying the filter and click on the first grid record. In rowSelect function: function (args) returns the previous record and not what is being presented.

rowSelected: function ( args )
                {                       
                       myapp.activeDataWorkspace.PEDIDOSData.TBLCDSCLI0_SingleOrDefault( args.data.Id ).execute().then(
                        function ( data )
                        {
                            ReturnCli( data, contentItem.screen );
                        } );

                    contentItem.screen.closePopup( "ConsultaClientes" );
                }
selected record: 66
record returned in args: 1

If i move to the second page and return to the page 1. The selected registry happens to return the correct value.
how to solve?


//CRIA A GIRD PERSONALIZADA
myapp.CadastraPedido.TBLCDSCLI0_render = function ( element, contentItem )
{
    var itemTemplate = $( "<div></div>" ).attr( 'id', 'TBLCDSCLI0' )

    itemTemplate.appendTo( $( element ) );

    contentItem.value.oncollectionchange = function ()
    {

        var database = contentItem.valueModel.source.target.source.member.id.split( "/" )[0]
        var table = contentItem.valueModel.name
        var vCollection = myapp.rootUri + "/" + database + ".svc/" + contentItem.valueModel.name;

        if ( itemTemplate.hasClass( 'e-grid' ) )
        {
            itemTemplate.ejGrid( 'destroy' );
        }
        var first = contentItem.children[0], fieldname = [];
        for ( i = 0; i < first.children.length; i++ )
        {
            fieldname[i] = { field: first.children[i].valueModel.name };
        }

        //Rendering the Grid Control
        itemTemplate.ejGrid(
            {
                dataSource: ej.DataManager( { url: vCollection } ),
                allowScrolling: true,
                scrollSettings: { width: 0, height: 400, allowVirtualScrolling: true, virtualScrollMode: ej.Grid.VirtualScrollMode.Continuous },
                isResponsive: true,
                enableResponsiveRow: true,
                allowSelection: true,
                allowFiltering: true,
                enableRowHover: true,                
                columns: [
                             { field: "Id", headerText: "Código", isPrimaryKey: true, textAlign: ej.TextAlign.Right, width: 80, priority: 1 },
                             { field: "CODIGO", headerText: "Código Solution", textAlign: ej.TextAlign.Right, width: 80, priority: 1 },
                             { field: "RAZAO", headerText: "Razão", textAlign: ej.TextAlign.Right, width: 120, priority: 1 },
                             { field: "FANTASIA", headerText: "Fantasia", width: 120, textAlign: ej.TextAlign.Right, priority: 1 },
                             { field: "CNPJ", headerText: "CNPJ", textAlign: ej.TextAlign.Right, width: 130, priority: 2 },
                             { field: "CPF", headerText: "CPF", width: 120, priority: 3 },
                             { field: "FONE", headerText: "Telefone", width: 110, priority: 4 }
                ],
                rowSelected: function ( args )
                {

                    myapp.activeDataWorkspace.PEDIDOSData.TBLCDSCLI0_SingleOrDefault( args.data.Id ).execute().then(
                        function ( data )
                        {
                            ReturnCli( data, contentItem.screen );
                        } );

                    contentItem.screen.closePopup( "ConsultaClientes" );
                }
            } );
    }
}

//ABRE O POPUP DE CONSULTA DE CLIENTE
myapp.CadastraPedido.PopupCliente_execute = function ( screen )
{
    $( window ).one( "popupcreate", function ( e )
    {
        $( e.target ).popup( {
            positionTo: "window",
            afteropen: function ( event, ui )
            {
                try
                {
                    if ( ConsultaCliente == 1 )
                    {
                        window.setTimeout( UpdateWid, 1000 );
                    }
                } catch ( e )
                {
                    ////// NAO FAZ NADA
                }
                //DEPOIS DE CARREGAR PRECISO ATUALIZAR ELE NO CENTRO DA TELA
                /**/
            }
        } );
    } );

    //screen.TBLCDSCLI0.load();
    if ( ConsultaCliente == 1 )
    {
        screen.TBLCDSCLI0.refresh();
    }
    screen.showPopup( "ConsultaClientes" );

    $( window ).scroll( function ( e )
    {
        UpdateWid();
    } );
}

function UpdateWid()
{
    $( window ).resize();
}

function ReturnCli( data, MyScreen )
{
    MyScreen.TBLCDSCLI0.selectedItem = data.results[0]
    MyScreen.TBLMVMPED0Item.setTBLCDSCLI0Item( MyScreen.TBLCDSCLI0.selectedItem );
}

Gowthami V [Syncfusion]
Replied On June 10, 2015 08:47 AM

Hi Artur,

Thanks for using Syncfusion products.

We considered this query “Selection is not working properly after filtering with enable virtualScrolling” as a bug and a support incident has been created under your account to track the status of this issue. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

Please follow up the new incident for better follow up.

Regards,
Gowthami V.

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.

;