Forum Replies Created
-
Author
-
April 9, 2015 at 2:06 pm in reply to: Date Range Filter in Virtual Mode Date Range Filter in Virtual Mode #69710
I have now updated to the latest version and I can confirm this issue (date filter) still remains in virtual mode
B
April 9, 2015 at 12:51 pm in reply to: Date Range Filter in Virtual Mode Date Range Filter in Virtual Mode #69707I would love to update to the latest version of jQWidgets, but last time I did this, a range of my grids stopped working because the internal function dataAdapter.loadjson changed the way it indexed data on pages after page 1… See http://www.jqwidgets.com/community/topic/cannot-read-property-uid-of-undefined/
If this has been amended then I will definitely update 🙂
Thanks,
B
April 8, 2015 at 5:30 pm in reply to: Date Range Filter in Virtual Mode Date Range Filter in Virtual Mode #69685Hi,
I am aware of how the PHP binding works, I have used this example to write the base of my code. However, there is still an underlying issue that I feel may be a bug.
When you apply a filter to a grid, the value you enter stays in the box you entered it. But, when you select a date or a date range, when in virtual mode, the value does not stay in the box. So, if you try to apply multiple filters to a grid, when you enter into a ‘text’ column, it ignores the filter you had applied to the date column.
I have applied all the same functions and code that your example advises, so I believe the problem lies in the code that handles filtering in virtual mode.
I have tried to manually do it using the ‘filter’ function but I did not succeed with this. Is there a callback once the filter has been applied that I can use to get the value sent to the server and then reinsert it back into the date field?
Thanks in Advance,
B
November 5, 2014 at 2:42 pm in reply to: Cannot read property 'uid' of undefined Cannot read property 'uid' of undefined #62216Is it okay if I email you instead as the jsFiddle I have created contains links to our software and as it is currently under development, we do not wish to publish these?
And then once we have solved it, we can post up the solution here if you feel it may help others 🙂
November 5, 2014 at 1:41 pm in reply to: Cannot read property 'uid' of undefined Cannot read property 'uid' of undefined #62207Okay, I will do my best to reproduce the issue and come back to you here when I have 🙂
November 5, 2014 at 1:26 pm in reply to: Cannot read property 'uid' of undefined Cannot read property 'uid' of undefined #62197Then surely that means that there is a bug in the callback function?
The data that I am passing into the callback function has not changed since I upgraded to version 3.5.0…
Shall I post up the exact data object being returned by both page 1 and 2?
November 5, 2014 at 12:37 pm in reply to: Cannot read property 'uid' of undefined Cannot read property 'uid' of undefined #62191Whilst I appreciate this, it was you that encouraged me to use this function in the first place (see here: http://www.jqwidgets.com/community/topic/using-virtualmode-with-loadserverdata/). Regardless, the loadjson function is not what is causing the issue here… Essentially, I need to know what information and in what format it needs to be passed to
callback({ records: dataAdapter.records, totalrecords: source.totalrecords });
Could you possibly supply me with that info? Once I have this, I should be able to sort it 🙂
November 5, 2014 at 12:13 pm in reply to: Cannot read property 'uid' of undefined Cannot read property 'uid' of undefined #62187There is only one difference between the dataAdapter.records when loading the initial page and when loading another page, this is the index of the items in it. For page one the object looks like this:
[Object, Object, Object, Object, Object...
However, for page 2, the object looks like this:
[15: Object, 16: Object, 17: Object, 18: Object...
The callback is obviously expecting the index of the dataAdapter.records to start at 0. Is this a bug, or should I correct it at my end?
November 5, 2014 at 12:05 pm in reply to: Cannot read property 'uid' of undefined Cannot read property 'uid' of undefined #62184Right, have confirmed that the issue is definitely occurring in the following line:
callback({ records: dataAdapter.records, totalrecords: source.totalrecords });
Shall I post up the data that is being passed?
November 5, 2014 at 12:00 pm in reply to: Cannot read property 'uid' of undefined Cannot read property 'uid' of undefined #62183Is the datafields ‘type’ a required parameter?
Unfortunately this is not the issue though. I think I have narrowed it down to a particular area having compared it to another one of my grids that is actually still working.
Could it be something to do with this:
source.beforeprocessing(data); dataAdapter.loadjson(null,data.results,source); callback({ records: dataAdapter.records, totalrecords: source.totalrecords });
November 5, 2014 at 11:38 am in reply to: Cannot read property 'uid' of undefined Cannot read property 'uid' of undefined #62179Its not very easy to make a jsFiddle as the code is dynamic and dependant on certain libraries etc. Instead, I will post my code up, but if it is too detailed to go through then let me know and I will do my best to try and put together a jsFiddle…
I think it is likely that this issue is just due to me not having set a property in the grid definition that is njow required in 3.5.0, as this was working before, and now it isn’t working on not just one, but every single grid I have in my software.
// Create the localize object var localizationobj = { decimalseparator: '.', thousandsseparator: ',' }; // Prepare the response data var source = { url: '//api.website.net/data/', datatype: "json", datafields: [ { name: 'reference', map: 'Reference' }, { name: 'date', map: 'Date', type: 'date' }, { name: 'so_reference', map: 'SO_Reference' }, { name: 'description', map: 'Description' }, { name: 'total', map: 'Base_Total', type: 'float' }, { name: 'buyer_details', map: 'Buyer_Details' }, { name: 'buyer_reference', map: 'Buyer_Reference' }, { name: 'order_number', map: 'Order_Number' }, { name: 'order_date', map: 'Order_Date', type: 'date' } ], sort: function(){ // Update the grid and send a request to the server. $("#sh_grid").jqxGrid('updatebounddata', 'sort'); }, beforeprocessing: function(data){ if(data!=null){ // Update the total records source.totalrecords = data.rows; } } }; // Get the shipments var settings = { loadServerData: function(serverdata,source,callback){ MN.ajax({ url: source.url, dataType: source.datatype, data: serverdata, cache: false, success: function(data){ // Set the aggregates $('#sh_quantity_aggregate').text(data.rows); $('#sh_total_aggregate').html('£'+data.aggregates.total); $('#sh_average_aggregate').html('£'+data.aggregates.average); // Run the before processing callback source.beforeprocessing(data); dataAdapter.loadjson(null,data.results,source); callback({ records: dataAdapter.records, totalrecords: source.totalrecords }); }, error: function(msg){ MN.ajaxError(msg,function(msg){ // Place the error message into the grid localizationobj.emptydatastring = msg; callback({ records: [] }); }); } }); } }; // Initialize the data adapter var dataAdapter = new $.jqx.dataAdapter(source,settings); // Initialize the grid $("#sh_grid").jqxGrid({ width: 1196, altrows: true, source: dataAdapter, theme: 'metro', selectionmode: 'singlerow', sortable: true, pageable: true, autoheight: true, pagesize: 15, pagesizeoptions: [15,30,50,100], virtualmode: true, enabletooltips: true, columnsresize: true, columns: [ { text: 'Ref.', datafield: 'reference', width: '8%' }, { text: 'Date', datafield: 'date', align: 'center', cellsalign: 'center', cellsformat: 'dd-MMM-yyyy', width: '8%' }, { text: 'Name', datafield: 'buyer_details', width: '23%' }, { text: 'Ref.', datafield: 'buyer_reference', width: '10%' }, { text: 'Contract No.', datafield: 'so_reference', width: '8%' }, { text: 'Description', datafield: 'goods_description', width: '16%' }, { text: 'Value', datafield: 'total', align: 'right', cellsalign: 'right', cellsformat: 'c'+user_settings.dp_Value, width: '9%' }, { text: 'No.', datafield: 'bol_number', align: 'left', cellsalign: 'left', width: '10%' }, { text: 'Date', datafield: 'bol_date', align: 'center', cellsalign: 'center', cellsformat: 'dd-MMM-yyyy', width: '8%' } ], rendergridrows: function(obj){ return obj.data; } }); // Bind the bindingcomplete event $("#sh_grid").bind('bindingcomplete',function(){ // Set the currency symbol localizationobj.currencysymbol = "£"; // Apply the localization object $("#sh_grid").jqxGrid('localizestrings', localizationobj); });
Okay brilliant, will give that a go. Thanks Peter 🙂
I don’t think I explained it very well, this hasn’t got anything to do with editing. See the following example, should be clearer:
I have a grid with content such as:
Address Line 1,
Address Line 2,
Post Code etc…However, the grid displays the content like so:
Address Line 1, Address Line 2, Post Code etc…
What I would like to know is whether this behavior can be prevented without editing the content. I want the grid to only display the first line of my content, but the tooltip to still show the full content…
July 16, 2014 at 8:42 am in reply to: Prevent Editor Blur on 'setcellvalue' Prevent Editor Blur on 'setcellvalue' #57284The computed column example looks like the perfect solution! Thanks Peter
July 15, 2014 at 4:35 pm in reply to: Prevent Editor Blur on 'setcellvalue' Prevent Editor Blur on 'setcellvalue' #57248Thanks for your prompt reply Peter.
I’m not surprised that is the case. However, is there a better way I can have a column that is editable and whilst it is edited, the another columns value is calculated? Or is it only possible to do once the cell edit has ended?
-
AuthorPosts