jQWidgets Forums

Forum Replies Created

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

  • dperry
    Participant

    You could grab the rows from the shopping car grid with

    var rows = $(‘#jqxGrid’).jqxGrid(‘getrows’);

    and then loop over the data to see if there’s a match by comparing fields.

    in reply to: jqxGrid not binding to JSON jqxGrid not binding to JSON #31717

    dperry
    Participant

    Can you verify the json string coming back from the php and the .net services are actually identical? The url you listed says “Tesr.asmx”, I’m assuming that’s supposed to be “Test.asmx” (typo)? Also, is the .net service setting the content type as “application/json” in the response header?


    dperry
    Participant

    I’ve done something similar to this in a project. What I did was set the wrapper div to fixed positioning with hidden overflow, docked to the window edges with space at the top for a header

    css:

    #gridWrapper {
    position: fixed;
    top: 100px;
    bottom: 0;
    right: 0;
    left: 0;
    }

    add a event listener to the window.resize event to call a method you have, such as resizeGrid, that calculates the height of the grid based on the window size and the number of records being displayed

        var resizeGrid = function () {
    var gridHeight = maxGridHeight;
    var $window = $(window);
    var screenHeight = minHeight < $window.height() ? $window.height() : minHeight;
    var remainHeight = screenHeight - 190; // extra padding
    if (remainHeight < minHeight) {
    remainHeight = minHeight;
    }
    if (remainHeight > gridHeight) {
    gridHeight = gridHeight + scrollbarPadding;
    }
    else {
    gridHeight = remainHeight;
    }
    gridElement.jqxGrid({height: gridHeight});
    };

    This relies on maxGridHeight being set when the grid data is loaded as follows:

    maxGridHeight = gridElement.jqxGrid(‘rowsheight’) * (items.length + 1 /* filter row */ ) + parseInt(gridElement.jqxGrid(‘columnsheight’), 10) + extraPadding;

    and minHeight being set to some minimum height you want in place for the grid — for example, to accommodate a grid with no items.

    Call resizeGrid after setting maxGridHeight in your data load method.

    Note, this is a modified / cleaned up version of what I’m using, so I haven’t tested it as listed here.

    in reply to: Manually set validator error Manually set validator error #31253

    dperry
    Participant

    I think I see, you’re saying have some rules for each of the fields that could get validated server side. Those rules would have some kind of boolean flag that would prevent them from being executed under normal circumstances. After posting the form and receiving the error messages associated with the fields, set the appropriate flags and then call $form.jqxValidator(‘validate’), correct?

    That should work for exactly what I need, thank you very much Peter.

    in reply to: Manually set validator error Manually set validator error #31197

    dperry
    Participant

    I still get all that. Is there a way to display a validation message that originated from outside the jqxValidator rules? Such as from a server-side response after submitting a ‘valid’ form?

    in reply to: Manually set validator error Manually set validator error #31191

    dperry
    Participant

    I guess the more direct question is ‘can I manually display an error through the jqxValidator?’ I would like to do client-side validation, and when that passes, perform a server-side validation and display any errors that come back in the ajax response. So the client-side would use the normal jqxValidation rules, and then if the actual form post comes back with any errors from the server, trigger an error message manually, perhaps with an event.

    in reply to: Manually set validator error Manually set validator error #31186

    dperry
    Participant

    I understand that, I would like to be able to apply any validation errors after submitting it. After the form has been validated, I would submit the form using an ajax post, and get a response back from the server containing any validation information that could not easily be done client-side. If there are any server-side errors that come back after submitting the ‘validated’ form, I would like to display those errors through the jqxValidator.

    in reply to: Manually set validator error Manually set validator error #31183

    dperry
    Participant

    I had used that example for validating a single field, but what I would like to do is submit the form after it has been validated, and then manually trigger any error messages received back from the server (multiple messages, not just using the commit() method within a single field validator).

    The server might say that the username is already taken, a date supplied might not fit within some data range, and perhaps a message saying that some combination of values entered isn’t valid for some reason.

    Thanks


    dperry
    Participant

    a standard browser tooltip isn’t part of the document, so it would appear over everything without being clipped. A standard tooptip can’t contain html though. It’s just the text that is in the title attribute of the element receiving the tooltip.

    A ‘tooltip’ generated by a library, such as the jqwidgets tooltip would be part of the document, and since the jqwidgets tooltip uses absolute positioning, it would be clipped as well.


    dperry
    Participant

    The grid cells are absolutely positioned divs with hidden overflow. You’d have to change the positioning of the popover to use fixed positioning to break out of that, but then also figure out where to place it, since fixed positioning places the element out of the document flow.

    in reply to: get all expanded group get all expanded group #19674

    dperry
    Participant

    you’d have to use ‘getrootgroupscount’ to get the count, and then call ‘getgroup’ for each. The returned object has an ‘expanded’ property on it.

    var expandedGroups = {};
    var count = gridElement.jqxGrid('getrootgroupscount');
    for( var i = 0; i < count; i++ ) {
    var group = gridElement.jqxGrid('getgroup', i);
    if( group.expanded ) {
    expandedGroups.push(group);
    }
    }
Viewing 11 posts - 1 through 11 (of 11 total)