jQWidgets Forums
Forum Replies Created
-
Author
-
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
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: trueAny help with this please? Thanks
Thank you Peter
Can anyone point me in the right direction to solve this problem? Many thanks
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
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
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
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 }
]
});
});July 17, 2012 at 10:28 am in reply to: how to include filter/sort/paging in grid how to include filter/sort/paging in grid #6037shougom
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
July 16, 2012 at 9:50 am in reply to: how to include filter/sort/paging in grid how to include filter/sort/paging in grid #5991Thank you peter. Is the purpose of the file: jqx-all.js to replace all required seperate js files? Thanks
July 16, 2012 at 8:01 am in reply to: how to include filter/sort/paging in grid how to include filter/sort/paging in grid #5983Ok 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
Thank you Peter.
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
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
-
AuthorPosts