jQWidgets Forums
Forum Replies Created
-
Author
-
July 9, 2014 at 7:55 pm in reply to: Show/Hide filter on button click Show/Hide filter on button click #56955
Fair enough. Here’s the issue if I just try using filterable toggle: http://jsfiddle.net/Am2Qk/1
You’ll notice whether data is bound to it (by clicking on the simulate button) or not, when filterable toggle set to true, it expands the area for it, but there’s no filter.
From my testing it seems to be my dynamic re-association of the data source. Which I could do without, if there would be a way to just re-associate the URL value and have it refresh data when I do that. Is there a way?
+1 for enhancement request of this feature.
July 9, 2014 at 5:21 pm in reply to: Show/Hide filter on button click Show/Hide filter on button click #56941I agree, this works as I mentioned as the source is set during document ready. But when source is set dynamically, it fails to then show the filter. Maybe the approach I am taking for doing it dynamically is wrong and/or not supported but I saw no way to on demand change the value of the url of the source. I need to set different parameters based on different criteria, and then force the treegrid to pull back data from that url on demand.
So if you were to use your exact example, but remove the source pieces from $(document).ready:
// prepare the data var source = { dataType: "csv", dataFields: [ { name: 'EmployeeKey', type: 'number' }, { name: 'ParentEmployeeKey', type: 'number' }, { name: 'FirstName', type: 'string' }, { name: 'LastName', type: 'string' }, { name: 'Title', type: 'string' }, { name: 'HireDate', type: 'date' }, { name: 'BirthDate', type: 'date' }, { name: 'Phone', type: 'string' }, { name: 'Gender', type: 'string' }, { name: 'DepartmentName', type: 'string' } ], hierarchy: { keyDataField: { name: 'EmployeeKey' }, parentDataField: { name: 'ParentEmployeeKey' } }, id: 'EmployeeKey', url: '../sampledata/employeesadv.csv' }; var dataAdapter = new $.jqx.dataAdapter(source);
and also from the // create Tree Grid remove the source: dataAdapter
now to simulate the on demand action I referred to, create a button, where on click you are setting the source info that was removed above, i.e.
$('#mybutton').on('click', function() { // prepare the data var source = { dataType: "csv", dataFields: [ { name: 'EmployeeKey', type: 'number' }, { name: 'ParentEmployeeKey', type: 'number' }, { name: 'FirstName', type: 'string' }, { name: 'LastName', type: 'string' }, { name: 'Title', type: 'string' }, { name: 'HireDate', type: 'date' }, { name: 'BirthDate', type: 'date' }, { name: 'Phone', type: 'string' }, { name: 'Gender', type: 'string' }, { name: 'DepartmentName', type: 'string' } ], hierarchy: { keyDataField: { name: 'EmployeeKey' }, parentDataField: { name: 'ParentEmployeeKey' } }, id: 'EmployeeKey', url: '../sampledata/employeesadv.csv' }; var dataAdapter = new $.jqx.dataAdapter(source); $('#treegrid').jqxTreeGrid({source:dataAdapter}); });
then I think you will see the behavior I am seeing as that is similar to what I’m doing. Except of course the URL part for me changes on demand.
May 5, 2014 at 9:22 pm in reply to: rowdata on updaterow returns wrong data when field(s) hidden? rowdata on updaterow returns wrong data when field(s) hidden? #53990Thanks for the nice workaround!
May 1, 2014 at 1:54 pm in reply to: Wrong row(s) selected after multiple rows deleted Wrong row(s) selected after multiple rows deleted #53829Nagoor – Thanks for sharing that. It’s similar to what I’m using now. I’m not blaming the grid. I’m trying to understand an odd behavior if it’s supposed to be normal for this grid. As I’ve been trying to explain, I don’t want to do a clearselection. I’m using of course a simple example for explanation of only 6 rows. But in reality it could be hundreds or thousands.
Again, the point is that before I delete entries in the grid, I send the selected rows for deletion to server side. Server returns the ones it was actually able to delete. So I iterate and delete those specific rows in the grid. But the ones that failed to delete server side, I want to leave as selected (via checkbox).
But it appears per what Peter and you are saying is that I can’t rely on grid to leave those selected. Instead I need to clear everything and iterate through the grid and select the ones that weren’t deleted server side manually because the grid’s selected indexes don’t properly update when rows are deleted automatically. And that’s what I find odd because it shows the wrong rows selected currently as rows are removed.
April 30, 2014 at 10:17 pm in reply to: Wrong row(s) selected after multiple rows deleted Wrong row(s) selected after multiple rows deleted #53800I’m using normal mode. My previous question on “also are you saying” was trying to understand more clearer what you were referring to your statement: not clear the selection when you delete/add/update row
I was hoping the delete behavior I saw was a bug. But appears you’re saying it’s designed this way. I find it rather strange, but ok. I will work around it and write extra code to deal with it.
Going back to my simple example of 6 rows, rows 2,3,4 selected (via checkbox), after server result comes back and says that it deleted successfully row 3 only, I do a delete using: $(‘#jqxGrid’).jqxGrid(‘deleterow’, rowId);
The row disappears correctly from the grid. While I expect row 2 and row 3 (what used to be row 4) to be selected, I don’t expect now for row 5 (which now became row 4) to be selected. Which is what the grid is doing.
But you’re saying that’s normal expected behavior.
April 30, 2014 at 2:36 pm in reply to: Wrong row(s) selected after multiple rows deleted Wrong row(s) selected after multiple rows deleted #53778That’s odd. Other grids I’ve used didn’t need that. With 3 items selected and 3 deleted, why would it not update the indexes internally automatically?
Further, I don’t want to clear all the selections for the following reason:
Using my example again, say I have 6 rows total. I select rows 2,3,4 (index 1,2,3) submit to server side to delete those rows. But server side may had error deleting one or more of those rows. Server side responds with an array of items that it was able to delete, for example only row 3 (index 2) and I delete that from the grid. I want rows 2, and what used to be 4 but is now row 3 to be shown as selected as they weren’t deleted server side. It will now show wrong rows selected.Of course I could keep track of all selected rows before sending server-side, upon server response clear the grid of selections, delete the rows returned from server-side that were really deleted, and select the ones that weren’t deleted. But I think it should be assistance of grid to do that for me to update the indexes automatically when I delete a row instead of doing the extra effort for delete.
Also, are you saying that if I have several rows selected and do an add that the selected rows now need to be cleared and reselected because the indexes are going to be wrong too?
April 29, 2013 at 7:16 pm in reply to: Why isn’t input tag working with numberInput? Why isn’t input tag working with numberInput? #20278Wow. Talk about being difficult! Are you actually reading what I wrote or just blindly responding?
I stated #1
… aside from the sample that uses a DIV, there is no where in the API docs that explicitly states that you can ONLY use a DIV. It would be helpful where you have such limitations that you state so in the docs.
When I look at: http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxnumberinput/jquery-number-input-getting-started.htm
It states
The next step is to create a DIV element within the body of the html document.
<div id='jqxnumberinput'></div>
But it doesn’t directly mean that others aren’t supported. It would have been more helpful to write somewhere there that DIV is the only tag supported at this time.
And 2) I asked
… why is DIV only supported instead of the expected Input tag? Is Input tag and others planned to be supported?
You’re not addressing my comment about lack of info that explicitly states to use DIV in the docs nor are you answering if this is a temporary limitation and will be addressed soon. Your response is very unhelpful! Telling me that DIV is used in the samples doesn’t automatically imply that ONLY DIV is supported. And I’m not arguing with you what you support, and realized that it’s DIV before I wrote the original post. So you’re missing my point and question. My point is that you need to make your documentation more clear. And my question still is left unanswered.
April 29, 2013 at 1:31 pm in reply to: Why isn’t input tag working with numberInput? Why isn’t input tag working with numberInput? #20235Peter yes I saw that it works with DIV. But my question was why is DIV only supported instead of the expected Input tag? Also, aside from the sample that uses a DIV, there is no where in the API docs that explicitly states that you can ONLY use a DIV. It would be helpful where you have such limitations that you state so in the docs.
Are is Input tag and others planned to be supported?
-
AuthorPosts