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
830
Filtering Numeric data based on formatting done on grid not datasource attached
posted

We are trying to filter numeric data, Grid filters on underlying data and not data format which is applied.

Do we have a method to filter data based on formatting applied and not datasource attached?

Thanks.

Parents
  • 1235
    Suggested Answer
    posted

    Hello Jeffrey,

    Filtering, based on the applied formatting can be achieved by creating an unbound column, which gets its value with the formatting function by the formula option. For example:


    { headerText: "Product type", key: "ProductType", dataType: "number", formatter: formatterFunction},
    { headerText: "Product type text", key: "ProductTypeText", dataType: "string", unbound: true,
        formula: function (data, grid) {
            return formatterFunction(data["ProductType"]);
        }
    }

    If you are using the Updating feature on editRowEnding event the bound column (ProductType in this example) should get the unformatted value of the unbound column.

    I have attached a working sample, demonstrating how this can be done.

    Please feel free to contact me if you have further questions.

    Regards,
    Ivaylo Hubenov
    Entry-level developer

    filterFormatter.zip
Reply Children
No Data