This is a migrated thread and some comments may be shown as answers.

[Solved] How to append script after a control's markup

0 Answers 33 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Marcin
Top achievements
Rank 1
Marcin asked on 07 Dec 2011, 11:07 AM
Hello,

I've got a problem with extending functionality of some Telerik's controls. I try to write extension method to load (and save) a user grid's preference settings. I'd like to enable that functionality in a most simple way - by adding this method below to the grid declaration. It looks like:
public static GridBuilder<T> LoadSettings<T>(this GridBuilder<T> src) where T : class
{
    var profile = new UserProfile();
    var grid = src.ToComponent();
    // some code
    return src;
}
However, I need to attach some client side scripts to that grid. I've been trying to use grid.ViewContext.Writer - but then script is rendered before the grid declaration. I've also tried to use a ScriptRegistrar and OnDocumentReadyStatements but it doesn't work with ajax partial load scenarios. It's important for me to get most generous solution. I'd be thankful for any advice. TIA.

Kind regards,
Marcin
Tags
General Discussions
Asked by
Marcin
Top achievements
Rank 1
Share this question
or