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, 10 months ago.
-
Author
-
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
Hi Sigit,
Have you come to a solution yet?
Walter
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
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
WalterHi 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,
DimitarjQWidgets team
http://www.jqwidgets.com/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?
WalterHi 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,
DimitarjQWidgets team
http://www.jqwidgets.com/Thank you, Dimitar.
Have you an idea, why the delete and update is not working?
Walter
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,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.