jQuery UI Widgets Forums Grid My first CRUD app / Problems

This topic contains 23 replies, has 4 voices, and was last updated by  Dimitar 10 years, 3 months ago.

Viewing 9 posts - 16 through 24 (of 24 total)
  • Author
  • My first CRUD app / Problems #51147

    sigit
    Participant

    hii mr peter,

    i already defined generate row function, but still doesnt work..
    -the table can generate.. but it cant create, read, update and delete data..

     var generaterow = function (i) {
                    
                }
                for (var i = 0; i < 10; i++) {
                    var row = generaterow(i);
                    data[i] = row;
                }

    please for correction my generate data…

    thank you mr peter..

    sigit

    • This reply was modified 10 years, 3 months ago by  sigit.
    • This reply was modified 10 years, 3 months ago by  sigit.
    My first CRUD app / Problems #51400

    wfr
    Participant

    Hi Sigit,

    Have you come to a solution yet?

    Walter

    My first CRUD app / Problems #51442

    sigit
    Participant

    hi walter..

    no.. haha.. i still find a way out how to CRUD this table..
    and i got a little solution,.. haha, the table can update rows, but.. it not generate on database..
    i think if it can generate on database. it is a great way out. and solve our problem. haha…

    look out..
    on demos :

    var generaterow = function (i) {
                    var row = {};
                    var productindex = Math.floor(Math.random() * productNames.length);
                    var price = parseFloat(priceValues[productindex]);
                    var quantity = 1 + Math.round(Math.random() * 10);
                    row["firstname"] = firstNames[Math.floor(Math.random() * firstNames.length)];
                    row["lastname"] = lastNames[Math.floor(Math.random() * lastNames.length)];
                    row["productname"] = productNames[productindex];
                    row["price"] = price;
                    row["quantity"] = quantity;
                    row["total"] = price * quantity;
                    return row;
                }
                for (var i = 0; i < 10; i++) {
                    var row = generaterow(i);
                    data[i] = row;
                }

    how to imple this demo code on my script

     var generaterow = function (i) {
                    <!--??????????????????????????????????-->
                }
                for (var i = 0; i < 10; i++) {
                    var row = generaterow(i);
                    data[i] = row;
                }

    if this resolve,, i have to be happy with jqwidgets..

    thank you wallter, Peter (sorry bad english)

    sigit

    • This reply was modified 10 years, 3 months ago by  sigit.
    My first CRUD app / Problems #51752

    wfr
    Participant

    Hi Peter,

    I have still no clue what I have to do to get the app running.
    I guess it’s the generaterow function.

      var generaterow = function (i) {
                  var row = {};
                  row["bh_id"] = bh_id;
                    row["datum"] = datum;
                    row["bank"] = bank;
                    row["bank_wert"] = bank_wert;
                    row["zu_an"] = zu_an;
                    row["zu_wert"] = zu_wert;
                    return row;
                 }
            
                
               // for (var i = 0; i < 2; i++) {
                 //   var row = generaterow(i);
                   // data[i] = row;
                // }

    How would the code look like if I wanted to add a empty row?

    Thank you
    Walter

    My first CRUD app / Problems #51755

    Dimitar
    Participant

    Hi Walter,

    The issue is that in your generaterow function, none of the variables bh_id, datum, bank, etc. are defined.

    To add an empty row, it should return an empty object, i.e. {}.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    My first CRUD app / Problems #51863

    wfr
    Participant

    Thank you for your reply,

    Is is correct to do it this way?

    var generaterow = function (i) {
                  var row = {};
                  row["bh_id"] = {};
                    row["datum"] = {};
                    row["bank"] = {};
                    row["bank_wert"] = {};
                    row["zu_an"] = {};
                    row["zu_wert"] = {};
                    return row;
                 }

    I have no errors. But no button is doing what it should. Any hints?
    Walter

    My first CRUD app / Problems #51903

    Dimitar
    Participant

    Hi Walter,

    You do not need generaterow to add an empty row. Just call:

    $('#jqxGrid').jqxGrid('addrow', null, {});

    Make sure you check the documentation entry for addrow for more information.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    My first CRUD app / Problems #51983

    wfr
    Participant

    Thank you, Dimitar.

    Have you an idea, why the delete and update is not working?

    Walter

    My first CRUD app / Problems #52011

    Dimitar
    Participant

    Hi Walter,

    Which part of the delete and update functionalities does not work – the client side or the server synchronisation (the source deleterow and updaterow callbacks)?

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 9 posts - 16 through 24 (of 24 total)

You must be logged in to reply to this topic.