javascript - Unique names are not coming in jqgrid filter functionality -


i have implemented filter functionality in jqgrid. logic iterate on data of grid , find unique values filter. selecting values present in filter can apply filter. 1 of strings present in column coming twice , same. e.g. row 1 : "abc", row 2: "abc",row 3: "def", row 4: "def", row 5 :"feg" values in filter should all,abc,def,feg getting all,abc,abc,def,feg. def not repeating. problem string or else. code is

getuniquenames = function(columnname) {         var data = $("#grid0").jqgrid('getgridparam', 'data');           var uniquetexts = [], text, textsmap = {}, i;          (i = 0; < data.length; i++) {              text=data[i][columnname];                            if (text !== undefined && textsmap[text] === undefined) {                              // test whether texts unique place in map.                              textsmap[text] = true;                              if (typeof text =="string" && text.trim()!=''){                              uniquetexts.push(text);                              }                          }                      }                   // object.keys(textsmap); not work ie8:                       return uniquetexts;      } 


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -