Forum Replies Created
-
Author
-
If that is the case, then how are we doing it in the demo provided for state maintenance.
In this demo, we change the sort and apply some filters. Then press save state button to save the state.
Now we refresh the page. Navigate to same page and then press load state to restore the state of the grid we saved.
This works. How? Because we refreshed the page, isn’t this equal to saving state in one grid and loading the state to another grid?
Thanks
RajaMay 7, 2014 at 3:44 am in reply to: Formatting headers of Grid when exporting. Formatting headers of Grid when exporting. #54071Hello Peter,
I also need to format the data. Can we configure the format of date to be exported in jqx grid or we have to do it using getrows method?
Thanks
RajaMay 5, 2014 at 7:27 am in reply to: Formatting headers of Grid when exporting. Formatting headers of Grid when exporting. #53924Thanks for reply.
This is what I am doing Peter. I just wanted to know if there is some configuration provided by framework for the same.
Actually, I call exportdata like:
var contentGrid = $(gridObj).jqxGrid(‘exportdata’,’tsv’,undefined,true,undefined,false);
1. Now I get the first(the header) row of contentGrid and manipulate it to remove “|”
2. Same way, I remove last(aggregation) row from contentGrid using contentGrid.subString(0,contentGrid.getLastIndex(‘\n’))Thanks
RajaMarch 21, 2014 at 6:59 am in reply to: Filtering with custom sortFunction: Focus from control lost Filtering with custom sortFunction: Focus from control lost #51541Yes, I am trying to implement heck.
When I try to print the id of focused filter, I see that every second time the focused filter id is not correct which is generated. See this:
First try – Focus successfull because the id which is returned by focused filter is correct.
id – jqxWidget3aad454c
element – <input autocomplete=”off” type=”textarea” id=”jqxWidget3aad454c” class=”jqx-widget jqx-widget-bluefin jqx-input jqx-input-bluefin jqx-widget-content jqx-widget-content-bluefin” style=”width: 190px; height: 20px; margin: 4px;”>Second try – Focus failed because the id which is returned by focused filter is not matching with the id of input control
id – 2 jqxWidget3aad454c
element – <input autocomplete=”off” type=”textarea” id=”jqxWidgetce4d8663” class=”jqx-widget jqx-widget-bluefin jqx-input jqx-input-bluefin jqx-widget-content jqx-widget-content-bluefin” style=”width: 190px; height: 20px; margin: 4px;”>Third try – Focus successfull because the id which is returned by focused filter is correct.
id – jqxWidgetce4d8663
element – <input autocomplete=”off” type=”textarea” id=”jqxWidgetce4d8663” class=”jqx-widget jqx-widget-bluefin jqx-input jqx-input-bluefin jqx-widget-content jqx-widget-content-bluefin jqx-fill-state-focus jqx-fill-state-focus-bluefin” style=”width: 190px; height: 20px; margin: 4px;”>Focus failed – ids not matching again
id – 2 jqxWidgetce4d8663
element – <input autocomplete=”off” type=”textarea” id=”jqxWidgetf1ef399d” class=”jqx-widget jqx-widget-bluefin jqx-input jqx-input-bluefin jqx-widget-content jqx-widget-content-bluefin” style=”width: 190px; height: 20px; margin: 4px;”>Should not the focusedfilter should always point to the input element?
If focusedfilter will not work here, can you suggest something with which I can get hold of the input element.btw, this is the code what i have written here:
$(element).on('filter', function(event) { event.args.owner.focusedfilter.focus(); });
March 20, 2014 at 7:59 pm in reply to: Filtering with custom sortFunction: Focus from control lost Filtering with custom sortFunction: Focus from control lost #51529Ok, got it why it is working every second time. I tried to get hold of id of the input box and tried something like:
$(element).on('filter', function(event) { var xid = $(event.args.owner.focusedfilter).attr('id'); console.log(xid); $('#'+xid).focus(); });
The console log printed this:
2 jqxWidgetd3a24628 Grid.js?version=8.0.0.8.0.0:523
2 jqxWidget80477522 Grid.js?version=8.0.0.8.0.0:523
jqxWidget485ec106 Grid.js?version=8.0.0.8.0.0:523So, the ids when found duplicate, focus does not work. The number 2 in the above console log show that there are 2 elements with same ids. For the third id, which is unique, focus does gets back to the input box.
Can you please give me some idea why it is doing that way? As far as I know, whole grid is reconstructed so does the input box. Hence we should always get uniquely generated ids, isn’t it?
March 20, 2014 at 6:31 pm in reply to: Filtering with custom sortFunction: Focus from control lost Filtering with custom sortFunction: Focus from control lost #51522Peter,
I have found a way with which we can focus the textbox in filter row. We capture the filter event which is fired after the firtering has happened and with the help of the event which is passed to the handler, we write:
$(element).on('filter', function(event) { event.args.owner.focusedfilter.focus(); });
But this works alternatively, can you please provide some input on this. Please this is urgent.
Thanks
RAJAMarch 20, 2014 at 8:17 am in reply to: custom filter function getting called multiple times custom filter function getting called multiple times #51477So you mean if we have two custom functions, one for sorting and another for filtering. Both having call to update bound data then we will end up in stack overflow?
By the way I do not think I have any other custom function.
Thanks
RajaMarch 20, 2014 at 7:11 am in reply to: Filtering with custom sortFunction: Focus from control lost Filtering with custom sortFunction: Focus from control lost #51472Thanks for your support and patience.
March 19, 2014 at 6:06 pm in reply to: Filtering with custom sortFunction: Focus from control lost Filtering with custom sortFunction: Focus from control lost #51426Peter, sorry for that but you are confusing me.
Built in filter functionality is fine but the problem is that because we have custom sort function, built in filter function calls my sort function and the focus goes away from the control.
So, we are back to the originally asked question:
If we have implemented custom sort function, then how do we keep the focus on control in tact while filtering?Peter, can’t we discuss this over call?
Thanks
RajaMarch 19, 2014 at 5:38 pm in reply to: Filtering with custom sortFunction: Focus from control lost Filtering with custom sortFunction: Focus from control lost #51419Ok Peter. so to conclude this –
1. I have to implement the filter function by myself.
2. Implement custome filter when implementing custome sorting.Please confirm this.
BTW, do you have source code of the example you provided. It will be really helpfull if you have one.
Thanks
RajaMarch 19, 2014 at 4:53 pm in reply to: Filtering with custom sortFunction: Focus from control lost Filtering with custom sortFunction: Focus from control lost #51412What I mean is that, I have gone through the example of custom filtering
I understood everything but how will I get hold of column in which I am typing in order to filtering to happen. Remember I am using filter row.
So, If the filter row is visible and we have textbox for two columns First Name and Last Name, how will I come to know which column I am typing in to filter.
Thanks
RajaMarch 19, 2014 at 4:14 pm in reply to: Filtering with custom sortFunction: Focus from control lost Filtering with custom sortFunction: Focus from control lost #51409Thanks for your response. I looked into the example you provided and please confirm my understanding:
My understanding is, if we write custom sort function then we should also write custom filter function and with in that we need to call updatebounddata with filter parameter.
Do you also have an example of custom sort with filter row?
Thanks
RajaMarch 19, 2014 at 12:01 pm in reply to: Filtering with custom sortFunction: Focus from control lost Filtering with custom sortFunction: Focus from control lost #51393Hello Peter,
As mentioned in my post, I have already tried all the possible parameters to updatebounddata but it is not working.
Request you to go through my post again and answer the following questions:
1. Why the grid is calling sort function when filtering the data.
2. Is it neccessary to call sort function when filtering is called.
3. What is the way to code so that sortFunction should not be called when we filter the data.Thanks
Raja -
AuthorPosts