jQWidgets Forums
Forum Replies Created
-
Author
-
September 28, 2012 at 9:05 pm in reply to: Achieve filtering with Virtual Scrolling enabled Achieve filtering with Virtual Scrolling enabled #8667
Thanks Peter! I would still need textbox for entering my search string to filter rows on each column.
September 28, 2012 at 1:01 pm in reply to: Achieve filtering with Virtual Scrolling enabled Achieve filtering with Virtual Scrolling enabled #8639Don’t know how to write this in MVC 3 using Entityframework. Is there a way I can disable virtual scrolling as soon as user enters search string for any of the column filters & enable it when there’s no search string for any of filters?
Found the solution after spending sometime playing with it. Thanks Peter!
Hello Peter,
Trying to paste some code here, let me know if it doesn’t make any sense to you. BTW, I am using MVC3.
var codeTypeCol = ‘City Name’; // sets column name based on user selection
if(type==’z’ || type==’Z’) // type is a variable that reads user selection ,if he/she wants it by Zip Code or by City Name
codeTypeCol=’Zip Code’;$.ajax({
datatype: “json”,
url: “/websitename/controllername/FindCityofEmployees”, //url
data: { state: state, codeType: type }, // parameter to controller action
beforeSend: function (result) {
$(‘#jqxgrid’).toggle(); // hide grid
$(‘.processbar’).toggle(); //show processbar
},
success: function (result) {
$(‘#jqxgrid’).toggle(); //show grid once we have results
$(‘.processbar’).toggle(); // hide processbarvar source = {
datatype: “json”,
datafields: [{ name: ‘FName’ }, { name: ‘LName’ },
{ name: ‘City’ }],
localdata: result
};var dataAdapter = new $.jqx.dataAdapter(source, { downloadComplete: function (data, status, xhr) { }, loadComplete: function (data) { }, loadError: function (xhr, status, error) { } });
$(“#jqxgrid”).jqxGrid({
width: 930,
showfilterrow: true,
filterable: true,
selectionmode: ‘singlecell’,
source: dataAdapter,
theme: ‘ui-redmond’,columns: [{ text: ”, datafield: ‘City’, width: 60, cellsrenderer: chkboxrenderer }, { text: codeTypeCol, datafield: ‘City’, width: 150},
{ text: ‘First Name’, datafield: ‘FName’, width: 350 },
{ text: ‘Last Name’, datafield: ‘LName’,width: 300}]
});
}
});var chkboxrenderer = function (row, datafield, value) {
‘input type=”checkbox” name=”chkCity” id=”chkCity” value=”‘ + value + ‘” />’;
Thanks!I used that as an example for my development, not sure if I am missing something .Let me try to simulate what I am trying to do. Say for ex: you have a column called ‘City’ in your grid. You also have Radiobutton say ‘City Name’ or ‘Zip Code’. If you select city name grid column would be of type string & numeric in case user selected by zip code. I need to change filter type based on user selection. The one for string is working fine but not the one for numeric. I want the filter row column to be textbox & not select list with options like ‘null,not null, greater than…’
-
AuthorPosts