Next
Update
Prev
Search
Next
Previous

You can search the records that contain the input string using the KoolGrid API, getSearchString(). This example demonstrates how to find the records any column value contains the input string.


function search() {
  gridRoot.setSearchString(inputForm.searchStr.value);
  var result = gridRoot.search(inputForm.searchStr.value);
  if (result == false) {
    alert(inputForm.searchStr.value+" cannot be found.");
    inputForm.btnNext.disabled = true;
    inputForm.brnPrevious.disabled = true;
  } else {
    inputForm.btnNext.disabled = false;
    inputForm.brnPrevious.disabled = false;
  }
}

function searchNext() {
  var srchStr = gridRoot.getSearchString();
  if (srchStr == null || srchStr.length == 0)
    alert("Enter the string you want to search and click the Search button.");
  else
    gridRoot.searchNext();
}

function searchPrevious() {
  var srchStr = gridRoot.getSearchString();
  if (srchStr == null || srchStr.length == 0)
    alert("Enter the string you want to search and click the Search button.");
  else
    gridRoot.searchPrevious();
}

© 2017 KoolChart. All rights reserved.