jQWidgets Forums
Forum Replies Created
-
Author
-
Hi Peter,
Sorry for my very belated reply to this!
Thank you for pointing this out, feel very dumb that I didn’t notice it!!
As an additional point, the ‘simple’ mode is basically what I want, however, I want the user to be able to enter the specified ‘groupSeparator’ as well as numbers and decimals… Is is possible to add this functionality to a future release?
In other words, I do not want the input to look like this:
_,___,__.__
but I want the user to be able to enter this:
5,111,22.10 (notice the group separators)
Thanks,
B
October 24, 2013 at 9:54 am in reply to: Row Details on Particular rows Row Details on Particular rows #31292No problem, thanks anyway
This is how I am currently doing it, is there a better way?
ready: function(){ // Remove any tabindex's set by the grid $('#grid [tabindex]').removeAttr('tabindex');}
I think I have solve it by changing the following:
var rowindex = $('#sh_grid').jqxGrid('getselectedrowindex');var rowdata = $('#sh_grid').jqxGrid('getrenderedrowdata',rowindex);
to
var rowindex = $('#sh_grid').jqxGrid('getselectedrowindex');var rowdata = $('#sh_grid').jqxGrid('getrowdata',rowindex);
Why has this fixed my issue?
May 30, 2013 at 8:42 am in reply to: Width relative to Scroll bar Width relative to Scroll bar #22136Didn’t think about that, I was using autosize. This should do the trick, thanks
May 23, 2013 at 12:51 pm in reply to: Using 'virtualmode' with 'loadServerData' Using 'virtualmode' with 'loadServerData' #21760Dont worry all sorted with the paging, it was an SQL error
But I would still like to know info about the ‘dataadapter.loadjson’. Can I use this to map my json data and then pass it to the grid?
May 23, 2013 at 11:54 am in reply to: Using 'virtualmode' with 'loadServerData' Using 'virtualmode' with 'loadServerData' #21754That’s awesome, all sorted as far as data displaying goes…
What is the ‘dataadapter.loadjson’ method? I cannot find this in the documentation… Does this handle the mapping etc??
I am now experiencing another issue with the paging whereby, on the first page, my data object contains 20 items, but as soon as I press the next page button, my new loaded object contains all my rows not just the next 20… This is obviously a server side issue, but it may be caused by the parameter that is being sent to the server. I am about to debug it and see what I can find, if you have any insight on this then please share…
May 23, 2013 at 10:35 am in reply to: Using 'virtualmode' with 'loadServerData' Using 'virtualmode' with 'loadServerData' #21745I only placed ‘obj.data’ there because I saw it in a ‘virtualmode’ example… I wasnt too sure what it was doing but it seemed to work.
I have now debugged it and it seems that ‘rendergridrows’ is not even being called… I have done the following:
rendergridrows: function(obj){ console.log('test'); console.log(obj); return obj.data;},
Absolutely nothing is appearing in the console. I cannot see where else I could be going wrong…
Just sent through, thanks Peter
If ‘records’ is meant to be an array, how does it know which fields to map to which values.
Consider this result structure:
[{"Shipment_Reference":"","Shipment_Date":"","Buyer_Address":"","Buyer_Reference":"","Main_SO_Reference":"","Base_Total":"","Terms_of_Delivery":"","Bill_Of_Lading_Date":,"Bill_Of_Lading_Number":"","Goods_Description":""}]
Whereas, in array format it will just be indexed like so and it cannot be multidimensional:
["0":"","1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":"","9":""]
How should I structure my result?
Update
Furthermore, ‘data.results’ is actually an array or results. My callback now looks like this:
callback({ records: data.results, totalrecords: data.rows });
This looks like the perfect solution, thank you!
I have tried to implement this myself but have run into trouble. Am I missing something?
Here is my code:
// Prepare the response datavar source = { datatype: "json", datafields: [ { name: 'reference', map: 'Shipment_Reference' }, { name: 'date', map: 'Shipment_Date', type: 'date' }, { name: 'so_reference', map: 'Main_SO_Reference' }, { name: 'goods_description', map: 'Goods_Description' }, { name: 'total', map: 'Base_Total', type: 'float' }, { name: 'buyer_details', map: 'Buyer_Address' }, { name: 'buyer_reference', map: 'Buyer_Reference' }, { name: 'terms_of_delivery', map: 'Terms_Of_Delivery' }, { name: 'bol_date', map: 'Bill_Of_Lading_Date', type: 'date' }, { name: 'bol_number', map: 'Bill_Of_Lading_Number' } ]};// Get the shipmentsvar settings = { loadServerData: function(serverdata,source,callback){ MN.ajax({ url: '//api.domain.net/documents/?'+query, dataType: source.datatype, success: function(data){ console.log(data); // Send the data to the data adapter callback({ records: data }); }, error: function(msg){ console.log('error'); } }); }};// Initialize the data adaptervar dataAdapter = new $.jqx.dataAdapter(source,settings);
Thanks for your help, I have managed to sort it after some extensive debugging in my code.
Thanks again
I am doing exactly what it states in the example, as shown here:
var source = { url: '//www.example.net/test.php', datatype: "json", datafields: data.datafields, data: {reference:'test'}, root: 'items', cache: false, filter: function(){ // Update the grid and send a request to the server. $("#mfs_grid").jqxGrid('updatebounddata', 'filter'); }, sort: function(){ // Update the grid and send a request to the server. $("#mfs_grid").jqxGrid('updatebounddata', 'sort'); }, beforeprocessing: function(data){ if(data != null){ // Update the total records // THIS NEEDS UPDATING //source.totalrecords = data[0].TotalRows; } }};
I am sure I could get it to work using the format data property, but just want to make sure I am not doing anything wrong…
All updated, now running version 2.8.3 and I am still having trouble sending the parameters with the data property. I assume it is sent as a GET variable?
May 8, 2013 at 12:08 pm in reply to: Virtual paging from PHP with Filtering Virtual paging from PHP with Filtering #20767I do apologise, that was the one page I forgot to check!
Thank you very much, sorry to waste your time
-
AuthorPosts