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
175
WebTextEditor only keeps one character after erasing
posted

Hi,

I'm using a WebDataGrid that display customers information.

In order to filter customers, I have added a WebTextEditor, above the grid, with a value into the NullText property.

When I type a text into the TextEditor, it works well and filter my customers. Then, if I keep down the backspace key and type again a word, characters only appear one by one; the first is replaced by the second, the second by the third etc...

Here's my code:

<div >
    <ig:WebTextEditor ID="Txt_Rec" runat="server" NullText="Recherche..." Font-Size="12pt" Height="25px" >
        <ClientEvents KeyUp="Filter" />
    </ig:WebTextEditor>
</div>

<div>

    <ig:WebDataGrid ID="Gri_Clt" runat="server" AutoGenerateColumns="False" Height="400" Width="100%">
        <Columns>
            ...
        </Columns>

        <Behaviors>
            <ig:Filtering Visibility="Hidden"></ig:Filtering>
                <ig:Selection CellClickAction="Row" RowSelectType="Single">
                    <SelectionClientEvents RowSelectionChanged="Gri_Clt_SelectionChanged" />
                </ig:Selection>
                <ig:Sorting AscendingImageAltText="Ascendant" DescendingImageAltText="Descendant"></ig:Sorting>
        </Behaviors>
    </ig:WebDataGrid>

</div>

And my filter function :

function Filter() {

    // met les boutons à disabled
    var z_Mod = $get("Cmd_Mod");
    var z_Sup = $get("Cmd_Sup");

    z_Mod.disabled = true;
    z_Sup.disabled = true;

    var grid = $find("Gri_Clt");
    var searchTextBox = $get("Txt_Rec");
    var filtering = grid.get_behaviors().get_filtering();

    // Set up column filter for country name column

    var columnFilter = filtering.get_columnFilterFromKey("NomClt");
    var colFilterExists = (columnFilter ? true : false);

    if (!colFilterExists) {
        columnFilter = filtering.create_columnFilter("NomClt");
    }

    columnFilter.get_condition().set_rule($IG.TextFilterRules.Contains);
    columnFilter.get_condition().set_value(searchTextBox.value);

    if (!colFilterExists) {
        filtering.add_columnFilter(columnFilter);
    }
    else {
        filtering.applyFilters();
    }
}

Best regards,

TL

Parents Reply Children
No Data