Suppose you’re working with server side code, one column has first name [Mary, John, Mark, Ivan,…], one column has last name [Brown, Novak, Jensen, Horvat…]. If you were to select “Novak” in one column, all you want to see in the other column is [Filip, Jan]. I found one way to do this. On the server side, add an array to your JSON:
{
"firstName": [
"Filip",
"Jan"
]
}
In your grid, before you declare your source:
var filterFirstName = new Array();
Then when you make your source:
beforeprocessing: function(data)
{
if (data != null)
{
// From here, use :
// filterFirstName.shift(); -- To remove the first item from the list
// filterFirstName.unshift(data[x].firstName[i]); -- To add a new element to the beginning of the list
// filterFirstName.push(data[x].firstName[i]); -- To add a new element to the end of the list
// filterSchoolList.length = 0; -- Clears the list (as of this moment, I am not sure if this has any effect on garbage collection)
//
// filterFirstName.pop() doesn't seem to work.
// Resetting the array to [] also doesn't work.
}
}
…before adding it on to your grid:
{ text: 'First Name', datafield: 'firstName', displayfield: 'firstName', filtertype: 'checkedlist', filteritems: filterSchoolList, width: 200 },