jQWidgets Forums

Forum Replies Created

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

  • nigelwright7558
    Participant

    The grid and window don’t follow the browser window size.
    This fixed it for me:

    $(window).bind(‘resize’, function () {
    $(“#jqxgrid”).jqxGrid(‘width’,$(window).width());
    $(“#jqxwindow”).jqxWindow(‘width’, $(window).width());
    $(“#jqxgrid”).jqxGrid(‘updatebounddata’, ‘cells’); //refresh screen
    }).trigger(‘resize’);

    in reply to: Grid resize. Grid resize. #107227

    nigelwright7558
    Participant

    The problem was the window and grid weren’t being resized to the browser window size.
    So I copied browser window width to jqxgrid and jqxwindow and that fixed the problem.


    nigelwright7558
    Participant

    I am not sure what I have done but it is now working ok.
    Another problem I found with column width not changing suddenly just fixed itself !!
    Must be a cache or refresh problem.


    nigelwright7558
    Participant

    If I don’t do updatebounddata the screen is out of date.
    If I do updatebounddata the screen is correct but it always goes back to page 0.
    The code just goes away and deletes the rows in the database.

    `
    //////////////////////////////
    // delete row

    deleterow: function (rowid, commit) {

    var cx;
    for (cx = 0; cx < rowid.length; cx++) {

    $.ajax({
    url: ‘@Url.Action(“deleterow”, “Home”)’,
    type: ‘POST’,
    contentType: ‘application/json;’,
    data: JSON.stringify({
    id2: rowid[cx]
    }),

    success: function (valid) {
    $(“#jqxgrid”).jqxGrid(‘updatebounddata’, ‘data’);
    commit(true);
    },
    error: function () {
    alert(‘error!’);
    }
    });
    }
    }


    nigelwright7558
    Participant

    I have done as you suggested but it still goes to page 0.

    I event tried using the bind event to goto a page but that doesnt work either.
    The problem seems to be the deleterow is an asynchronous event and returns before it has done anything causing the page to always be zero.
    I tried making the event synchronous but that made no difference.

    If I make a button that goes to page 0 that works fine, I just cant get it to do it after a deleterow or addrow event.

    in reply to: Problems with widgets in mvc Problems with widgets in mvc #102907

    nigelwright7558
    Participant

    It doesn’t work on my pc.
    I copied the last part of that page into my view called test.
    It doesn’t display anything.
    It seems odd my code runs ok in _layout.cshtml but not in index.cshtml
    If I run my own code then the .ready functions are called ok but the calls to make the button is not. save1 is displayed but save2 isn’t.
    `
    <script type=”text/javascript”>
    $(document).ready(function () {
    alert(‘save1’);
    // Create save Button.
    $(“#jqxButtonSave”).jqxButton({ width: ‘180’, height: ’25’ });
    alert(‘save2’);
    // Subscribe to Click events.
    $(“#jqxButtonSave”).on(‘click’, function () {
    alert(‘save3’);

    });
    });
    </script>

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