jQWidgets Forums

Forum Replies Created

Viewing 15 posts - 46 through 60 (of 67 total)
  • Author
    Posts
  • in reply to: destroy window destroy window #6441

    mr_putersmit
    Participant

    Dimitar

    Thank you for example. 2 points: Firstly, when the Cancel button is clicked, does this remove the window. Secondly, Instead of removing from button, is it just a case of using $(‘div’).remove(‘#jqxwindow’); in a statement and also doing grid refresh? thanks

    in reply to: destroy window destroy window #6416

    mr_putersmit
    Participant

    Thank you dimitar. Much appreciated. There was one more thing if I may. The code I am using is not inserting the OK button in the window when it launches. What is the correct way to have OK button or cancel. Thanks

    okButton: $('#ok'),
    OK: true

    in reply to: destroy window destroy window #6412

    mr_putersmit
    Participant

    Any help with this please? Thanks

    in reply to: Delete button not firing Delete button not firing #6312

    mr_putersmit
    Participant

    Thank you Peter

    in reply to: Delete button not firing Delete button not firing #6305

    mr_putersmit
    Participant

    Can anyone point me in the right direction to solve this problem? Many thanks

    in reply to: rowdata is undefined rowdata is undefined #6248

    mr_putersmit
    Participant

    Hi Peter

    The second parameter in the ‘addrow’ method call is the row’s id. If you don’t pass one, the Grid will generate a random ID.

    How do I get the id back from db and not xml? The example you give uses’ xml. Thanks

    in reply to: rowdata is undefined rowdata is undefined #6240

    mr_putersmit
    Participant

    Hi Peter

    In your code, the deleterow has 2 params which is incorrect because the Grid calls that function with 1 param only.

    rowdata is generate by the developer i.e by you. In your scenario you are passing an empty array.
    $(“#jqxgrid”).jqxGrid(‘addrow’, null, []);

    can you give examples please. Thanks

    in reply to: rowdata is undefined rowdata is undefined #6238

    mr_putersmit
    Participant

    Thank you Peter. What this doesn’t make clear at least to me is, where, rowdata and row id are generated. What I am trying to do is add a new blank row and then enter details using editable option. When I tried to use code you helped me with when I need assistance for ‘adding new blank row’, it just displays blank grid.

    Also, this line: var data = “insert=true&” + $.param(rowid); in the addrow function. This gives me 4 digits for id when there are only 2 digits in db? How do I correct that. Thanks

    in reply to: add new blank row add new blank row #6038

    mr_putersmit
    Participant

    Peter
    I am struggling to get this to work. I can include blank row but it is not getting the next id. How can I change my code to get next id (auto inc) and also save to db. Also, is there a way to confirm or cancel before I enter into db? Thanks

    $(document).ready(function () {
    // prepare the data
    var source =
    {
    datatype: "json",
    datafields: [
    { name: 'id'},
    { name: 'type'},
    { name: 'service'},
    { name: 'quantity'},
    { name: 'department'},
    { name: 'date', type: 'date', format: 'yyyy-MM-dd HH:mm:ss'},
    ],
    url: 'data.php',
    updaterow: function (rowid, rowdata) {
    // synchronize with the server - send update command
    var data = "update=true&type=" + rowdata.type + "&service=" + rowdata.service + "&quantity=" + rowdata.quantity;
    data = data + "&department=" + rowdata.department + "&date=" + rowdata.date;
    data = data + "&id=" + rowdata.id;

    $.ajax({
    dataType: 'json',
    url: 'data.php',
    data: data,
    success: function (data, status, xhr) {
    // update command is executed.
    alert(data);
    }
    });
    }
    };

    var dataAdapter = new $.jqx.dataAdapter(source);

    $("#jqxgrid").jqxGrid(
    {
    source: source,
    theme: 'classic',
    width: 900,
    altrows: true,
    pageable: true,
    sortable: true,
    filterable: true,
    autoheight: true,
    pagesizeoptions: ['10', '20', '30', '40'],
    editable: true,
    ready: function () {
    var button = $("");
    button.jqxButton({ height: 20 });
    button.click(function () {
    $("#jqxgrid").jqxGrid('addrow', null, []);
    });
    $(".jqx-grid-pager > div:first").append(button);
    },

    columns: [
    { text: 'id', editable: false, datafield: 'id', width: 100 },
    { text: 'Type', datafield: 'type', width: 150},
    { text: 'Service', datafield: 'service', width: 150 },
    { text: 'Quantity', datafield: 'quantity', width: 180 },
    { text: 'Department', datafield: 'department', width: 90 },
    { text: 'Date', datafield: 'date', cellsformat: "dd/MM/yyyy HH:mm:ss", width: 230 }
    ]
    });
    });


    mr_putersmit
    Participant

    shougom

    Hi. After playing with this for some time, the way I got it to work was to just use the jqx-all.js file instead of dependencies. Hope that helps. Cheers


    mr_putersmit
    Participant

    Thank you peter. Is the purpose of the file: jqx-all.js to replace all required seperate js files? Thanks


    mr_putersmit
    Participant

    Ok I have now tried to join the filter code with sort code, but now get unexpected token error. Do I need to merge sort code with filter code? Thanks

    in reply to: add new blank row add new blank row #5963

    mr_putersmit
    Participant

    Thank you Peter.

    in reply to: add new blank row add new blank row #5961

    mr_putersmit
    Participant

    Thank you peter. However, that example seems to be inserting data into the grid from either db or xml. What I am trying to achieve is, when I click add new row button, blank cells are inserted into the grid so I can enter data and save them to MySql. Thanks

    in reply to: add new blank row add new blank row #5956

    mr_putersmit
    Participant

    Cam I take it then that this is not possible? I am familiar with the technique for adding a row which updates grid from db, but i need to add new entry to db. If someone could just can confirm whether this is possible, I would be grateful. Thanks

Viewing 15 posts - 46 through 60 (of 67 total)