I'm working on a project where I am using the AJAXToolkit Accordion. What I am trying to achieve is the following. I want to capture the event of when the header of the Accordion has been clicked prevent that relevant section of the Accordion from opening and instead postback to the server to populate a DataGrid within the body section of the Accordion, once the DataGrid is populated then expand the selection that was just prevent from opening. (I know how to fire a postback to the server). I have searched the internet with no avail.
Handle accordion open event on the client side (selectedIndexChanging) and use PageRequestManager ( js object handling postbacks ) to do postback and get updated grid.
Alternatively you can OnItemCommand(AjaxControlToolkit.AccordionCommandEventArgs) event and look for selectedIndex command ( not sure with the name though) and trigger databind on grid on the server side.
Related
I have a grid which is rendered dynamically based on the table selected by the user. The grid has a last column which has a header template in which I have provided a button. On click of this button I want to call angularjs controller function which I did using ng-click=ctrl.addnewRow() .
Problem I am facing is that, when the grid is loaded for the table in the first Kendo TAB the "+"(add) button does not work. When I navigate to a different tab which is using the same grid and same template, the button click works as expected. I have been scratching my head to figure out what the problem is, but could not find the problem or solution. Here is a snapshot of the page. I have used highlighting for sensitive data.
See the "+" button, and the code below in the debug window. Thats not working for the first tab.
Let me know if anyone needs some more information.
EDIT
I have created a kendo UI Dojo where the add buttons do not work for both tables. I did not add any tabs based on my scenario, but this fiddle should help
I have a drop down list inside a data grid in main page and upon changing values it should display popup and popup values are posted back to the main page. I have to trigger onchange event which is not working.
Below is the code I am using.
Server side:
ddlID.Attributes.Add("OnChange", "return Show("txtFName.text,txtLstName.text");
Client side:
$('#ddlID').val(6).trigger("change"); //should hit function Show() which is not triggered.
Finally I figured out. The control is inside data grid and when I am using the ID directly via jquery ($('#ddlID')), it is not working. I have to get the client side ID using $(""#"+ddlID.ClientID+"""). Also we can use class selector. I am triggering on change using a external js file.
My ASP page has a DropDownList (DDL) and a bunch of checkboxes. When my user selects a DDL item, I have some JS/jQuery code to make several checkboxes invisible according to some logic. However, the postback of the DDL, needed to run the C# code-behind event handler, causes a redraw of the entire page and makes all checkboxes visible.
How can I prevent the postback from wiping out the actions of the JS? Should I store visibility bits in something like ViewState?
Is it possible to have the JS code run AFTER the postback, instead of before?
Is it possible/easy to use CallBack instead of PostBack for the ASP DropDownList? I was thinking that the fun of Ajax was avoiding postbacks and only updating the control instead of the entire page.
Well if the dropdown posts back in the same action that you flip the switch for the checkboxes, why not then put the logic to show/hide checkboxes on the server instead of the client? You can use the hidden field approach, and that would work fine.
The callback means the UI needs updated by JavaScript. I don't know what all the postback updates, but you would have to send everything up via JSON, and refresh the UI via JavaScript. So only you can make that call.
I have an accordion of 5 panels. Each panel contain a set of checkboxes. I want to attach the change event to the checkboxes. But as the panels are collapsed the checkboxes dont get rendered and as a result I cannot attache the events. Any idea how do I do this.
Note : I am using ExtJS designer to make the accordion and the checkboxes.
Stuff done so far.
I added a class to the checkboxes and tried to access them using the query
Ext.query('.winrej');
this however gives me list of checkboxes from the panel that is open.
If the checkboxes are not rendered yet you will not catch any user interaction events, so it doesn't make sense to subscribe to them. Try to subscribe to events after certain panel of accordion layout has been rendered. Or am I missing something? What exactly are you trying to achieve?
I'm doing some ASP using Telerik.
On my page there are 2 buttons called Create Window and Postback. The Create Window button created a new RadWindow dynamically on it's click event (client-side) by using window.radopen(). The Postback button simply does a postback. My problem is that, the windows get lost after every postback. What can I do to make my RadWindows to remain opened after a postback, including its content and position.
If there is no built-in function to restore my dynamic RadWindows, please tell me how to save current windows content to manually load it on the next postback. I thought of using a Hidden control to save my RadWindow position and content, but how can I do that (it's content is a user control with plentiful textboxes, and i don't want my customer to re-type all the textboxes).
The RadWindows are generated via JavaScript when they are first shown. You can easily check this via your developer plugin of choice. Once you show them they create their wrapper div as a direct child of the form element. This means that they have no server-side rendering and thus cannot be persisted on the server across postbacks.
What you can do is use AJAX - have the button perform an AJAX request that will update the needed content of the page, but will leave the RadWindows out of the update. Check out this help article where they explain how to use AJAX with a RadWindow: http://www.telerik.com/help/aspnet-ajax/radwindow-ajaxifying.html.