7

Here issue is in the kendogrid column menu filter is not having limit to filter i don't need the negative value .In second image while enter the arrow it's going negativeve values how to restrict the negative value?

enter image description here

OnaBai
  • 40,767
  • 6
  • 96
  • 125
stpdevi
  • 1,114
  • 3
  • 15
  • 36

1 Answers1

8

Use the filterMenuInit event of the grid. Then find the numeric textbox and set its min value to 0 using the min method. Here is a sample implementation:

  <div id="grid"></div>
  <script>
  $("#grid").kendoGrid({
    dataSource:{ 
      data: [ 
        { name: "Jane Doe", age: 30 },
        { name: "Jane Doe", age: 33 }      
      ],
      schema: {
        model: {
          fields: {
            age: { type: "number" }
          }
        }
      }
    },
    filterable: {
      extra: false
    },
    filterMenuInit: function(e) {
      var numeric = e.container.find("[data-role=numerictextbox]").data("kendoNumericTextBox");
      if (numeric) {
        numeric.min(0);
      }
    }
  });
  </script>

And a live demo: http://jsbin.com/itiwos/1/edit

Iman Mahmoudinasab
  • 6,861
  • 4
  • 44
  • 68
Atanas Korchev
  • 30,562
  • 8
  • 59
  • 93
  • thank you for reply my version 2012 with licensed ,is it not working in old version(2012)? – stpdevi Apr 30 '13 at 09:35
  • Indeed, the filterMenuInit event was introduced in the Q1 2013 release. – Atanas Korchev Apr 30 '13 at 10:10
  • Is it possible to use 2012 version using any other event. – stpdevi Apr 30 '13 at 10:11
  • ok thank you one more is we have different columns with different ranges(0.7,123,5555,67 like this) but i also need to apply max value, so please can you tell me to how to apply the different max value for different columns? – stpdevi Apr 30 '13 at 10:51
  • 1
    You can put the title of the column in the jquery selector: $("#grid th:contains(age) .k-grid-filter") http://jsbin.com/itiwos/3/edit – Atanas Korchev Apr 30 '13 at 11:06