jQWidgets Forums

Forum Replies Created

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts

  • viperbyte
    Member

    Super thanks Dimitar. It works and I couldn’t be happier:)


    viperbyte
    Member

    Thanks Dimitar,

    At least now I know how to filter on multiple columns like the way the code you showed me works. But what that code is doing doesn’t exactly do what I need. As-is what the code does is “ColumnA contains AND ColumnB contains”, what I need is “ColumnA contains OR ColumnB contains”. Do you or anyone know how I can get this type of result? Please.

    Thanks,
    Juan


    viperbyte
    Member

    I now have a new problem. I was able to filter the grid by binding the keyup event in an input box name txtSearch with some code that I got from this site. It filters on the first column of the grid. The column’s name is Organization_Name. But the filtering must be able to look at all the columns of the grid. So i binded another column which is called “address_street” and it doesn’t work. I have exprimented with the value of filter_or_operator using a 1 or a 0 and that hasn’t helped. I don’t know if I’m going about this all wrong or if I’m just a little off, or if this can even be done at all. Can someone super please tell me if this can be done and if so, how should I go about doing this? The following is my attempt to get the filtering to apply to two columns: Organization_Name and address_street.


    $(function () {
    $('#txtSearch')
    .bind('keyup', function (event) {
    //alert('Hello');
    var datafield = "Organization_Name";
    var searchText = $("#txtSearch").val();
    var filtergroup = new $.jqx.filter();
    var filter_or_operator = 1;
    var filtervalue = searchText;
    var filtercondition = 'contains';
    var filter = filtergroup.createfilter('stringfilter', filtervalue, filtercondition);
    filtergroup.addfilter(filter_or_operator, filter);
    $("#jqxgrid").jqxGrid('addfilter', datafield, filtergroup);
    // apply the filters.
    $("#jqxgrid").jqxGrid('applyfilters');
    })
    .bind('keyup', function (event) {
    //alert('Hello');
    var datafield = "address_street";
    var searchText = $("#txtSearch").val();
    var filtergroup = new $.jqx.filter();
    var filter_or_operator = 1;
    var filtervalue = searchText;
    var filtercondition = 'contains';
    var filter = filtergroup.createfilter('stringfilter', filtervalue, filtercondition);
    filtergroup.addfilter(filter_or_operator, filter);
    $("#jqxgrid").jqxGrid('addfilter', datafield, filtergroup);
    // apply the filters.
    $("#jqxgrid").jqxGrid('applyfilters');
    });
    });


    viperbyte
    Member

    I used a snippet of code from the third link you provided combined with the keyup event on the input box.
    Super thanks Dimitar:)


    viperbyte
    Member

    Thank you so much Peter.
    I can breath easier now. I didn’t know I had all that code available to me in the demos folder, good to know. Hopefully I’ll be able to put this little project together finally relativley soon.

    Thanks.


    viperbyte
    Member

    Hello Peter,

    By any chance can you provide the generatedata javascript function mentioned in the above code?

    -Juan


    viperbyte
    Member

    Thanks Peter.

    I’m closer now than before because of your help. I took the sample you provided and had it somewhat working the way I need. I won’t be using a jqWindow, I’ll be using an aspx page but what was mentioned in the code showed me how to get to the values in a row of a grid. My problem now though is how do I get the row? The code fragment you supplied already had the row value selected and passed in to the code block in the variable “row”. I’ve tried to get the selected row with the below code and it doesnt’ work. When I click on my Edit button a call to a function named test3 is supposed to display one of the grids values but it doesn’t. When I click the Edit button the only thing that happens is that the grid is reloaded. When I hard code a 3 in the call to innerFunction and uncomment the call to innerFunction then information does display. For what it’s worth. But hard coding it is no good of course. How do I get the row index? Please.

    function test3() {

    $(“#jqxgrid”).bind(‘rowselect’, function (event) {
    var selectedRowIndex = event.args.rowindex;

    innerFunction(selectedRowIndex);

    });
    //innerFunction(3);
    }

    function innerFunction(myIndex) {

    editrow = myIndex;

    var dataRecord = $(“#jqxgrid”).jqxGrid(‘getrowdata’, editrow);

    alert(dataRecord.Organization_Name);

    }


    viperbyte
    Member

    Thanks Peter.

    I have it like this now but nothing happens when I click on a row now. Earlier with this code the alert function would work but now I don’t know why it will not work. Any ideas?

    $(“#jqxgrid”).bind(‘rowselect’, function (event) {
    var row = event.args.rowindex;
    var datarow = $(“#jqxgrid”).jqxGrid(‘getrowdata’, row);
    alert(‘booboo’);
    });

    in reply to: How to JSON with jqxGrid? How to JSON with jqxGrid? #6952

    viperbyte
    Member

    Thanks Peter for the help.

    In that link the tutorial uses a project in which the webservice will be called like this: url: ‘http://localhost:1216/Service.asmx/GetData’. That line was in the $.ajax({…part of the code where GetData is the WebService. The WebService I have available to work with comes in the form of a Method like deomonstrated in my original post. The way the Call is used in the origianal post, it puts data in the txtArea named textResults. I don’t know how to incorporate the code from the link you provided and such similar code I have seen with the CallWS method that I have to work with. Super thanks though. Can anyone pleeeease show me how to get my method CallWS to work with the jqxGrid?

    in reply to: How to JSON with jqxGrid? How to JSON with jqxGrid? #6904

    viperbyte
    Member

    I just reviewed my post and see how ugly that code at the bottom came out. The code is at this site at this link http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-datasources.htm At that page you scroll down a bit till you get to the “Bind the Grid to JSON data” section.

Viewing 10 posts - 1 through 10 (of 10 total)