0

I am using the Telerik RadGrid which has a MasterTableView inside of it.

Currently I have ClientEvents defined in markup

<ClientSettings>
   <ClientEvents OnGridCreated="gridCreated"></ClientEvents>
</ClientSettings>

And then I just handle it in a separate javascript file like this

var masterTableView;

gridCreated = function (sender) {
    masterTableView = sender.get_masterTableView();
};

What I would like to have is a function like

var grid;
initialize = function(gridId)
{
    grid = someFunction(gridId); // this will return me the Telerik Grid like sender above
}

I could then call this function from the .aspx and pass more parameters if needed. Inside the initialize function I would then take the gridId and grab the whole object like I did in the gridCreated function. From there I would then just grab the masterTableView and do things I have to do.

Is this possible to achieve because I would love to keep my markup as small as possible and have the javascript file be as reusable as possible?

1 Answer 1

1

If you pass the gridId to a function, you can use the $find(gridId) inside of that function to get an instance of the grid client-side object.

More details here: http://www.telerik.com/help/aspnet-ajax/grid-getting-client-object.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.