jQWidgets Forums
Forum Replies Created
-
Author
-
August 18, 2016 at 10:24 am in reply to: Grid works at server1 but does not work at server2 Grid works at server1 but does not work at server2 #86665
Hi Christopher,
thanks for your reply. After checking the error log on, it seems there’s no MySqli module installed on the other server. I’ll try to install it, as it is less pain than modifying the script for mysql functions instead of mysqli…
Thanks for the guideline, but I’m afraid I need more specific help
I have tried this :$("#getSelected").on('click', function () { var rowindex = $('#jqxgrid').jqxGrid('getselectedrowindex'); var rowindexes = $('#jqxgrid').jqxGrid('getselectedrowindexes'); var data = $('#jqxgrid').jqxGrid('getrows', rowindexes); alert(data.company_name + " " + data.RecordID); });
what I get as a response is : undefined undefined
I’m trying to get the data for ALL the selected rows…
What I am doing wrong here?Hi Peter,
thanks for your reply. Works fine. Is it possible to get instead of those indexes MY id :
datafields: [ { name: 'RecordID', type: 'number'}, { name: 'company_name', type: 'string'} ], cache: false, id: 'RecordID',
which is ‘RecordID’ ?
May 2, 2016 at 9:33 am in reply to: Error trying to edit grid data Error trying to edit grid data #84023I managed to find out the error. It was the
$result->bind_param('ssi', $_GET['company_name'], $_GET['no_so'], $_GET['RecordID']);
statement where the parameters number didn’t match with the number of $_GET variables. THANKS for the directions!!!May 2, 2016 at 9:26 am in reply to: Error trying to edit grid data Error trying to edit grid data #84022Hi Peter,
thanks for the quick reply. I was trying to do that but I don’t get any error message from the php file : $res = $result->execute() or trigger_error($result->error, E_USER_ERROR);
How can I display errors from data.php?September 10, 2013 at 10:43 am in reply to: Server side column validation? Server side column validation? #28664I’d appreciate if someone could direct me to the right place in this issue…. Thanks!
May 23, 2013 at 10:23 am in reply to: links not working in iPad touchscreen links not working in iPad touchscreen #21744Thank you Peter! All I had to do is to UPDATE to the newest version…
May 23, 2013 at 9:44 am in reply to: links not working in iPad touchscreen links not working in iPad touchscreen #21740That’s correct Peter. Here’s my .js.php file :
<?$link = mysql_connect(DB_SERVER, DB_USER, DB_PASS);if (!$link) { die('Not connected : ' . mysql_error());}// make foo the current db$db_selected = mysql_select_db(DB_NAME, $link);if (!$db_selected) { die ('Can\'t use foo : ' . mysql_error());}$sel_pers = mysql_query("SELECT id, permission_name FROM user_permissions WHERE permission_name != 'superadmin' ORDER BY id ASC"); $state_cou = mysql_num_rows($sel_pers); $permission_name = ""; $ri = '1'; while($state_row = mysql_fetch_array($sel_pers)) { if($ri <= $state_cou) { $permission_name .= "'".$state_row['permission_name']."', "; } else { $permission_name .= "'".$state_row['permission_name']."'"; } $ri++; }?><script type="text/javascript">$(document).ready(function () { // prepare the data var data = {}; var theme = 'classic'; var source = { datatype: "json", datafields: [ { name: 'id', type: 'number' }, { name: 'username', type: 'string' }, { name: 'full_name', type: 'string' }, { name: 'userlevel', type: 'string' }, { name: 'email', type: 'string' }, { name: 'phone', type: 'string' } ], id: 'id', url: 'grid/jqwidgets/controllers/users_controller.php', deleterow: function (rowid, commit) { // synchronize with the server - send delete command var data = "delete=true&id=" + rowid; $.ajax({ dataType: 'json', url: 'grid/jqwidgets/controllers/users_controller.php', data: data, success: function (data, status, xhr) { // delete command is executed. commit(true); } }); }, updaterow: function (rowid, rowdata) { // synchronize with the server - send update command var data = "update=true&" + $.param(rowdata); $.ajax({ dataType: 'json', url: 'grid/jqwidgets/controllers/users_controller.php', data: data, success: function (data, status, xhr) { // update command is executed. } }); } }; var linkrenderer = function (row, column, value) { if (value.indexOf('#') != -1) { value = value.substring(0, value.indexOf('#')); } var format = { target: '"_blank"' }; var html = $.jqx.dataFormat.formatlink(value, format); return html; }; // filter var addfilter = function () { var filtergroup = new $.jqx.filter(); var filter_or_operator = 1; var filtervalue = ''; var filtercondition = 'contains'; var filter1 = filtergroup.createfilter('stringfilter', filtervalue, filtercondition); filtervalue = ''; filtercondition = 'starts_with'; var filter2 = filtergroup.createfilter('stringfilter', filtervalue, filtercondition); filtergroup.addfilter(filter_or_operator, filter1); filtergroup.addfilter(filter_or_operator, filter2); // add the filters. $("#jqxgrid").jqxGrid('addfilter', 'firstname', filtergroup); // apply the filters. $("#jqxgrid").jqxGrid('applyfilters'); }; var dataAdapter = new $.jqx.dataAdapter(source); var editrow = -1; // initialize jqxGrid $("#jqxgrid").jqxGrid( { source: dataAdapter, width: "100%", <? if ($permisssionToEditUser == 1) { echo "editable: true,"; } ?> theme: theme, pageable: true, autoheight: false, columnsresize: true, filterable: true, autoshowfiltericon: true, sortable: true, columns: [ //{ text: 'ID', datafield: 'id', editable: false, width: 35 }, { text: 'Username', datafield: 'username', cellsrenderer: linkrenderer, editable: false }, { text: 'Full Name', datafield: 'full_name' }, { text: 'Userlevel', datafield: 'userlevel', columntype: 'dropdownlist', createeditor: function (row, cellvalue, editor) { var dataSource = [<?=$permission_name;?>]; editor.jqxDropDownList({source: dataSource }); } }, { text: 'Email', datafield: 'email' }, { text: 'Phone', datafield: 'phone' } ] }); $("#deleterowbutton").jqxButton({ theme: theme }); // delete row. $("#deleterowbutton").bind('click', function () { var selectedrowindex = $("#jqxgrid").jqxGrid('getselectedrowindex'); var rowscount = $("#jqxgrid").jqxGrid('getdatainformation').rowscount; if (selectedrowindex >= 0 && selectedrowindex < rowscount) { var id = $("#jqxgrid").jqxGrid('getrowid', selectedrowindex); var commit = $("#jqxgrid").jqxGrid('deleterow', id); } }); // trigger the column resized event. $("#jqxgrid").bind('columnresized', function (event) { var column = event.args.columntext; var newwidth = event.args.newwidth var oldwidth = event.args.oldwidth; $("#eventlog").html("Column: " + column + ", " + "New Width: " + newwidth + ", Old Width: " + oldwidth); }); });</script>
I’ve tried to set ‘autoheight’ to FALSE but the result was the same : still can’t click the link on a touchscreen platform (iOS, iPad)…
Any other suggestion? I appreciate your help!!!!!March 11, 2013 at 7:39 pm in reply to: Custom 'deleterow' function Custom 'deleterow' function #16737I see. So I cannot define a new method ‘delete_forever’ (as mentioned above). Is there a way to pass another variable (do_what) to the method ‘deleterow’ to set the ‘data’ dynamically? I.E. :
deleterow: function (rowid, commit) { // synchronize with the server - send delete command switch (do_what) { case 'restore': var data = "restore_file=true&id=" + rowid; break; case 'delete_forever': var data = "delete_forever=true&id=" + rowid; break; } $.ajax({ dataType: 'json', url: 'grid/jqwidgets/controllers/trash_files_controller.php', data: data, success: function (data, status, xhr) { // delete command is executed. commit(true); } }); },
Thank you in advance.
Best regards.January 24, 2013 at 4:09 pm in reply to: Checkbox not working after update to 2.6 Checkbox not working after update to 2.6 #14171That was that Peter, thank you!!!!
January 24, 2013 at 9:54 am in reply to: Passing a variable not working at Apache 2.2.21/PHP 5.3.8 Passing a variable not working at Apache 2.2.21/PHP 5.3.8 #14148Thank you Peter for your reply. I think I’m gonna change some methods that I thought will do the job…
January 15, 2013 at 9:10 pm in reply to: Upgrading to GRID 2.6 EDIT cell not working Upgrading to GRID 2.6 EDIT cell not working #13652I’m sorry guys, my mistake… The error was in the controller php file. Sorry to flood the forum with this otiose post!
November 21, 2012 at 8:28 am in reply to: Need help with "clickable" checkbox Need help with "clickable" checkbox #11275Heh, that was it!!!! Totally confused me that is WAS working with just true and wasn’t with false… Thanks Peter, you’re the man!
November 21, 2012 at 8:18 am in reply to: Need help with "clickable" checkbox Need help with "clickable" checkbox #11272I’ve managed to retrieve the $.param(rowdata) values and now I’m even more confused…. The ‘finished’ value is passed correctly : it is ‘true’ when checked and ‘false’ when unchecked.
I modified my php to :if ($_GET['finished'] == true) { $update_query_2 = "UPDATE tasks_on_project SET finished = '1' WHERE project_id = '".$project_id."' AND task_id = '".$task_id."'";}if ($_GET['finished'] == false) { $update_query_2 = "UPDATE tasks_on_project SET finished = '0' WHERE project_id = '".$project_id."' AND task_id = '".$task_id."'";}
It does NOT work when finished=false
What am I doing wrong???November 20, 2012 at 7:59 pm in reply to: Need help with "clickable" checkbox Need help with "clickable" checkbox #11245No, I’m using 2.4.2
Is there a way to check the value of $.param(rowdata)? Maybe in the browser console?
Thank you for helping me -
AuthorPosts