I am attempting to use jqGrid ASP.NET for the first time and I'm having an issue with properly using a parent and child grid on my form.
Scenario: On my form I have two grids, one a parent that displays product information, and a second child grid that is used for editing a collection of prices for the product in the parent row. When a user clicks the plus sign in a parent row, the OnDataRequesting event is handled and I load the child grid with that product's prices. When the user clicks a price in the child grid, I use ClientSideEvents RowSelect and the server side RowEditing event to perform inline editing.
All of this was fairly trivial to set up and works great. Where I'm having an issue is that I'd like the selected row in the parent grid to act like a context for the rest of the page, i.e. the rest of the page displays information related to the product selected (charts, graphs, etc). For this I set up an event handler for the OnRowSelecting event and then trap the RowKey from the event args. That works great. However... the unintended side effect of setting up that handler is that once a user selects a row in the child grid to edit, the OnRowSelecting event fires in the parent, the page posts back, and when the page reloads the child grid is closed and the attempted edit is thwarted.
What I would like to know is, is there any built in way to handle this sort of scenario either through the client side jqGrid library or the Trirand.Web library? Or will I need to write some custom script to either send the selected parent row asynchronously or possibly trap the expanded child grid and attempt to reopen it once the post back is complete? Thanks.
I thought I'd brush off the tumbleweeds here and inject the answer I finally received from Trirand's support. As of the time of this writing, you can't do this. If you handle the OnRowSelecting event, you cannot use an editable child grid as they built it to specifically fire the parent's OnRowSelecting event anytime you select a row in a child grid.
Related
I am trying (and failing) to get a very simple webpart working.
button which when pressed adds list item into custom list (this works great)
list out all the items from the custom list (this also works great)
the problem is that when i display the items and add a new item i need to refresh twice to get the listing to display the item that i am trying to display. What is the correct lifecycle that i need to follow with createchildcontrols, onload etc so that when i click the button and it adds a record in that the listing will display the newly inserted item.
Thanks
This is probably a case of setting the control values or forcing databinding in OnLoad; this is before the "add item" occurs which is before the new item has been added.
I recommend using Data-Binding expressions and ensuring databinding in PreRender1. As long all the controls follow this later-databinding it should Just Work. Otherwise, manually force update/databind the appropriate controls after (or in response to) the "add item" action.
The Life Cycle is the same as for ASP.NET WebForms, and summarized for the issue:
- "OnLoad"
- PostBack Actions such as "OnClick"
- "PreRender"
1 Databinding in PreRender works - even though it initially seems like it ought not to - because ASP.Net controls will Catch-Up as required.
I have few Ext.NET ComboBox controls on a Web Form. Selecting an item from the first fires the ValueChanged event to populate the second, and so on.
Except Force Selection property, I have not altered other properties of the ComboBox control.
I am experiencing odd behavior of Combo Box controls. As all controls get filled via AJAX request, I find it difficult to set focus on any control. As soon as I bring focus on any control, the cursor disappears after it gets filled.
Secondly, one of the ComboBox is not permitting me to select an item from the list. Even if I try to select an item, it automatically brings back the default item back, which is actually a sixth item in the list.
I double checked the queries and there is no way through which sixth item should get selected.
If I try to open the DropDown list using mouse, it opens for few seconds and collapses automatically.
Is there any way to fix these strange issue? Any other third-party open-source control?
I guess that combos are rebinded in each ajax requests
I suggest to rebind combos in Select direct event handler
Also see the following sample
http://examples1.ext.net/#/Form/ComboBox/Ajax_Linked_Combos/
I have a form with one gridview as master linked to a listview in the same page. Listview shows one record. this happens when i select a row in the grid.
I have successfully managed to get my listview to appear inside a jquery dialog. the problem is that i cant do the edits and insert when inside the dialog box. What happens is that after i press update , after the postback the dialog box has a blank form.
After researching (stackoverflow question) i have found that the problem MAYBE is that the dialog option creates a new div inside my div (by examing the resulting page). This breaks the association of the child elements of the listview and they appear blank....
the solution proposed there has to do with one field. How can i apply the logic to the whole list view?
In my application, I have a list box(list of stores), Add and Remove buttons and another list box (selected stores).
I have Following requirements:
1. On click of Add button, copy selected items from the master stores list to the selected store list and clear the selection from master store list.
2. On Click of Remove button, remove the selected stores from the selected stores list.
I have added my master store list box and selected store list boxes to 2 different update panels and added triggers for each of the update panel. Things are working fine but one thing I have observed that it is taking unusually long to move selected stores from master list to selected list. I have around 5000 entries in the master list of stores.
If I remove the update panel for master store list, things are normal but I am not able to clear the selection. Am I doing something wrong? Is there a way to clear selection of listbox outside the update panel.
It sounds like your using UpdatePanels to move ListItems between 2 ListBox controls. This creates a overhead as each time you trigger the 'add' event it has to postback and render the UpdatePanel again (including the viewstate).
Have you looked into using jQuery to move your list items between your ListBox controls thus all the moving between boxes is handled by the browser. This will speed up the experience for the user?
You should also be able to use jQuery to clear the selection. If you can provide me a little snippet of your markup I can help you get it written up (or shoot me a message).
Brian =)
I am trying to manipulate (move up and down, enable/disable and launch a form) child controls inside a panel control. However I am unable to get the id of the child control on which the click event occurs.
To illustrate, I am trying to create similar functionality as is available. I am trying to create the up-down buttons that you see in the image at http://i34.tinypic.com/2gugio6.jpg
Any help/pointers are appreciated.
Thanks
I am unable to get the id of the child control on which the click event occurs.
Use event.currentTarget inside the event handler to access the child control in which the event occurred.
It would help if you post some code. Since I don't know the details, I am giving you the most basic answer.
For example, if you want id of a button in your code, you specify that id in the mxml. So,
<mx:Button label="myButton" id="btn1"/>
Now, say in your script you want to add an event listener here, you access this as
btn1.addEventListener ....
Now, lets say you want to access not a button or some independent control, but you want to access elements inside a list, there are several ways. I am presuming you would like to access the selected item. You simply say
list1.selectedItem
As I said, it would help if you post your code and specify a more precise problem.