Filtering grid

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 );
}

1 Reply

GV Gowthami V Syncfusion Team June 10, 2015 12:47 PM UTC

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.

Loader.
Up arrow icon