jQWidgets Forums
Forum Replies Created
-
Author
-
November 18, 2022 at 9:50 pm in reply to: Field attribute of filter is undefined on initial filter Field attribute of filter is undefined on initial filter #125583
Maybe one small remark; Allthough the filter is being applied on initial load, the filter value itself is not visible in the input box of the column.
November 18, 2022 at 9:44 pm in reply to: Field attribute of filter is undefined on initial filter Field attribute of filter is undefined on initial filter #125578with the recent update, i’ve verified this defect again. I took the original fiddle (see first post) and initially observed it was not fixed, however after closer inspection it seems that https://jqwidgets.com/public/jqwidgets/jqx-all.js points to version 14. After manually updating the dependencies to the CDN available version 15 I can now see the filter applied (atleast, console logs are showing the expected values, as well as the GET request is including the expected filter data. The endpoint used does not support this type of filtering, it was just for proving the defects point)
Thank you for this long anticipated fix.
July 6, 2022 at 8:15 pm in reply to: server side add row in-line grid server side add row in-line grid #122020ok… with this feature is not supported, you mean adding rows to an empty grid when in virtual mode is not supported? Or adding rows in general in virtual mode is not supported (or partially supported)
I also noticed that when in virtualmode, when being on a page which is not the first page and then adding a row, i’m getting an error in the consol. So i first need to move to the first page and then it allows me to add a row.
Anyhow, i have been able to get it kind of working, but it’s not ideal. I’m switching between virtualmode false/true depending on the record count versus the pagesize. If the total record count is below pagesize, i disable virtual mode. Unfortuantely this means that updatebounddata needs to be triggered, causing an extra call to the back-end, and UI needs to wait for that to complete. As soon as the total record count moves above the pagesize, then I enable virtual mode, which again requires a call to updatebounddata.
Currently after the switching of virtual mode, the first click on the addrow button will fail, but next and remaining will succeed, making it a non-ideal solution. If anyone else has some other ideas to make this better, then please do help
// add new row. addButton.click(function (event) { let dataInfo = container.jqxGrid('getdatainformation'); //check if the total records on the grid is less than the pagesize and if virtualmode is enabled. //If so, disable virtual mode else enable virtual mode let toggled = false; if (dataInfo.rowscount < dataInfo.paginginformation.pagesize && container.jqxGrid('virtualmode')) { toggleVirtualMode(container, false); toggled = true; } else if (dataInfo.rowscount === dataInfo.paginginformation.pagesize && !container.jqxGrid('virtualmode')) { toggleVirtualMode(container, true); toggled = true; } let addrow = function () { _this.add_row_index++; let add_id = 'noid' + _this.add_row_index; //always go to first page. When trying to add while being on antother page, exception is thrown. //todo: check which page we're on and only go if not first. and wait for page to be loaded before adding. container.jqxGrid('gotopage', 0); container.jqxGrid('addrow', add_id, {}, 'first'); // //select the row let boundIndex = container.jqxGrid('getrowboundindexbyid', add_id); container.jqxGrid('selectrow', boundIndex); container.jqxGrid('ensurerowvisible', boundIndex); container.jqxGrid('beginrowedit', boundIndex); } //if we toggled the virtualmode, then databinding must complete before adding row //so we wait until the binding is completed, in a non-blocking manner and once completed //we add the row. if (toggled) { function wait() { if (!container.jqxGrid('isBindingCompleted')) { console.log("."); setTimeout(wait, 100); } else { addrow(); } } wait(); } else { addrow(); } });
July 4, 2022 at 8:46 pm in reply to: server side add row in-line grid server side add row in-line grid #121988ok, so rendergridrows is never called when adding the first row, so problem is not there.
I got it working with virtualmode = false and removing the rendergridrows, but then my server side pagination is broken (and probably search as well). And i’m not happy with having to implement server side paginanating manually while the grid is already supporting that.
Is there any other option which allows virtualmode=true? Else I’d suggest to consider this as a defect, because I do not see an obvious reason why we would not be able to add a new row to an empty grid when using virtualmode.
July 4, 2022 at 4:21 pm in reply to: server side add row in-line grid server side add row in-line grid #121987Well… the virtualmode is there for a reason. It allows me to do server side pagination, atleast that’s my understanding. I’ll have to have a look at renderGridRows and what it does when there’s no data. My guess is that i’d need to create array object with a single record that represents the new row and that should fix it as well, theoratically. I’ll come back on this after diner
July 3, 2022 at 7:48 pm in reply to: server side add row in-line grid server side add row in-line grid #121980I have a partially working solution.
I do NOT define an AddRow function
I create a add row button with the following handler:addButton.click(function (event) { _this.add_row_index++; let add_id = 'noid' + _this.add_row_index; //always go to first page. When trying to add while being on antother page, exception is thrown. container.jqxGrid('gotopage', 0); container.jqxGrid('addrow', add_id, {}, 'first'); // //select the row let boundIndex = container.jqxGrid('getrowboundindexbyid', add_id); container.jqxGrid('selectrow', boundIndex); container.jqxGrid('ensurerowvisible', boundIndex); container.jqxGrid('beginrowedit', boundIndex); });
and then I define a editrow function which handles the communication to the server. So the editRow function is handling both new and existing rows.
Now this works fine when there is already data on the grid, however when the grid is completely empty (no records) and I am adding the first record to the grid, then the row appears and then immediately dissapears. If there are already records available, then it’s not an issue.
I have reproduced this issue here:
No data – Not working:
https://jsfiddle.net/notedop/7nmLo5ds/59/When you click the + sign to add records, you can see that the grid count is increasing each time, but there are no editable/empty rows visible.
On the following fiddle you see the behaviour when the grid does have records. The new record is added and is editable as expected.
Data – Working:
https://jsfiddle.net/notedop/7nmLo5ds/61/May 31, 2022 at 10:44 pm in reply to: showfilterrow with custom filter operator does not select a default operator showfilterrow with custom filter operator does not select a default operator #121770Ok, i found one issue with my configuration. I was using filterType: “input” for both showfilterrow true and false (and on all columns), while the documentation states this can only be used with showfilterrow true.
When using filterType: “input” with showfilterrow true, then still no default filter condition is selected.
Is it possible to somehow set this?See columns, first 2 filters have first value as default condition, while last column has none.
https://jsfiddle.net/notedop/7nmLo5ds/46/May 31, 2022 at 10:30 pm in reply to: showfilterrow with custom filter operator does not select a default operator showfilterrow with custom filter operator does not select a default operator #121769Some additional observations
- When showfilterrow=true then on each column the values from the “filterstringcomparisonoperators” array are visible.
- When showfilterrow=false then the first 2 columns the values from the “filternumericcomparisonoperators” array are visible and the last column has the “filterstringcomparisonoperators” applied.
so when filterrow is enabled, the filter is not using the data type defined in the source to dynamically determine the filtertype. I’m not sure if this is as expected or not, but want to make awareness that there are clear differences between the behavior of filterrow enabled versus disabled.
May 30, 2022 at 3:19 pm in reply to: Field attribute of filter is undefined on initial filter Field attribute of filter is undefined on initial filter #121764I’ve had a look at the roadmap. Unfortunately it’s giving a 5 month window for the next release. Would you be able to share a bit more precise release schedule? Is there any patch or feature release planned for the near future? I’d like to determine if I should spent time on a work-around or if I should till the next release.
If it’s going to take some time, do you have a suggestion for a work-around? The way i’m currently planning to use / using the filter is in a parent-child grid (using remote, virtual data), where-as the child grid will need to have a filter applied to the ID column based on the expanded parent row. This means that the filter is dynamically defined in the initrowdetails function of the parent grid and applied during the child grid initialization.
May 24, 2022 at 7:24 pm in reply to: Field attribute of filter is undefined on initial filter Field attribute of filter is undefined on initial filter #121747Awesome, thank you for the quick response and confirmation on the bug. I’m looking forward to next release
May 23, 2022 at 6:58 pm in reply to: Field attribute of filter is undefined on initial filter Field attribute of filter is undefined on initial filter #121744Some more additional information; i have tried it with the latest 12.X, 13.X and 14.0.0 version and the behaviour is the same accross the last 3 versions. It does not seem to be recently introduced, if it’s a bug.
May 23, 2022 at 6:53 pm in reply to: Field attribute of filter is undefined on initial filter Field attribute of filter is undefined on initial filter #121743Adding the console output
{ filtercondition0: "CONTAINS", filterdatafield0: undefined, filterGroups: [{ field: undefined, filters: [{ condition: "CONTAINS", field: undefined, label: "1", operator: "or", type: "numericfilter", value: "1" }] }], filteroperator0: 1, filterscount: 1, filtervalue0: "1", groupscount: 0, pagenum: 0, pagesize: 10, recordendindex: 10, recordstartindex: 0, undefinedoperator: "and" } undefined
console output when manually setting a filter:
{ filtercondition0: "CONTAINS", filtercondition1: "LESS_THAN", filterdatafield0: undefined, filterdatafield1: "userId", filterGroups: [{ field: undefined, filters: [{ condition: "CONTAINS", field: undefined, label: "1", operator: "or", type: "numericfilter", value: "1" }] }, { field: "userId", filters: [{ condition: "LESS_THAN", field: "userId", label: "2", operator: "and", type: "numericfilter", value: "2" }] }], filteroperator0: 1, filteroperator1: 0, filterscount: 2, filtervalue0: "1", filtervalue1: "2", groupscount: 0, pagenum: 0, pagesize: 10, recordendindex: 10, recordstartindex: 0, undefinedoperator: "and", userIdoperator: "and" } undefined
-
AuthorPosts