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

[Solved] Jquery and ScriptRegistrar

0 Answers 100 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.
Jose Montero
Top achievements
Rank 1
Jose Montero asked on 11 Mar 2011, 12:46 AM
Hello:

This is the grid i am using:

<%

=Html.Telerik().Grid<SourceDTO>()

 

 

.Name(

"activityGrid")

 

 

.DataKeys(dataKeys => dataKeys.Add(source => source.SourceId))

 

.Columns(columns =>

 

{

 

columns.Bound(source => source.SourceId)

 

.Format(

"<a href='#' onclick=\"javascript:FindSource('{0}','S');return false;\">" +

 

 

 

"<img src='" + Url.Content(Constants.IMAGES_CONTENT_PATH) + "edit.gif' alt='{0}'/> </a>")

 

 

.Encoded(

false).Title("UPDATE")

 

 

.HtmlAttributes(

new { @class = "gridCenterCol" })

 

 

.HeaderHtmlAttributes(

new { @class = "gridCenterCol" })

 

 

.Width(70)

 

.Sortable(

false);

 

 

columns.Bound(source => source.SourceId)

 

.Format(

"<a href='#' onclick=\"javascript:alert('on progress..');\">" +

 

 

 

"<img src='" + Url.Content(Constants.IMAGES_CONTENT_PATH) + "edit.gif' alt='{0}'/> </a>")

 

 

.Encoded(

false).Title("SELECT")

 

 

.HtmlAttributes(

new { @class = "gridCenterCol" })

 

 

.HeaderHtmlAttributes(

new { @class = "gridCenterCol" })

 

 

.Width(70)

 

.Sortable(

false);

 

 

columns.Bound(source => source.SourceId)

 

.Format(

"<a href='" + "" + "'>" +

 

 

 

"<img src='" + Url.Content(Constants.IMAGES_CONTENT_PATH) + "delete.gif' alt='{0}'/></a>")

 

 

.Encoded(

false).Title("DELETE")

 

 

.HtmlAttributes(

new { @class = "gridCenterCol" })

 

 

.HeaderHtmlAttributes(

new { @class = "gridCenterCol" })

 

 

.Width(70)

 

.Sortable(

false);

 

 

columns.Bound(source => source.SourceTypeDescription).Title(

"Source");

 

 

columns.Bound(source => source.Description).Title(

"Description");

 

 

columns.Bound(source => source.Date).Title(

"Date Entered");

 

 

columns.Bound(source => source.LastUpdateDate).Title(

"Last Update Date").Width(215);

 

 

})

 

.ClientEvents(events => events.OnRowDataBound(

"activities_onRowDataBound"))

 

 

.DetailView(details => details.ClientTemplate(

 

Html.Telerik().Grid<

ActivityDTO>()

 

 

.Name(

"Activities_<#= SourceId #>")

 

 

.Columns(columns =>

 

{

 

columns.Bound(activity => activity.ActivityId)

 

.Format(

"<a href='#' onclick=\"javascript:FindActivity('{0}','A');return false;\">" +

 

 

 

"<img src='" + Url.Content(Constants.IMAGES_CONTENT_PATH) + "edit.gif' alt='{0}'/></a>")

 

 

.Encoded(

false).Title("UPDATE")

 

 

.HtmlAttributes(

new { @class = "gridCenterCol" })

 

 

.HeaderHtmlAttributes(

new { @class = "gridCenterCol" })

 

 

.Width(70)

 

.Sortable(

false);

 

 

columns.Bound(source => source.SourceId)

 

.Format(

"<a href='" + "" + "'>" +

 

 

 

"<img src='" + Url.Content(Constants.IMAGES_CONTENT_PATH) + "delete.gif' alt='{0}'/></a>")

 

 

.Encoded(

false).Title("DELETE")

 

 

.HtmlAttributes(

new { @class = "gridCenterCol" })

 

 

.HeaderHtmlAttributes(

new { @class = "gridCenterCol" })

 

 

.Width(70)

 

.Sortable(

false);

 

 

columns.Bound(activity => activity.PublicationDescription).Title(

"Publication").Width(101);

 

 

columns.Bound(activity => activity.ReasonDescription).Title(

"Reason").Width(101);

 

 

columns.Bound(activity => activity.Account).Title(

"Account").Width(101);

 

 

columns.Bound(activity => activity.Amount).Title(

"Amount").Width(101);

 

 

columns.Bound(activity => activity.CaseNumber).Title(

"DRS Case").Width(101);

 

 

columns.Bound(activity => activity.Date).Title(

"Date Entered").Width(140);

 

 

columns.Bound(activity => activity.LastUpdateDate).Title(

"Last Update Date").Width(140);

 

 

 

 

})

 

.DataBinding(dataBinding => dataBinding.Ajax()

 

.Select(

"ActivityListAjax", "Activity", new { sourceId = "<#= SourceId #>" }))

 

 

.Footer(

false)

 

 

.HtmlAttributes(

new { style = "Width : 925;" })

 

 

.ToHtmlString()

 

))

 

.DataBinding(dataBinding => dataBinding.Ajax().Select(

"SourceListAjax", "Activity"))

 

 

.Footer(

false)

 

 

.Scrollable(scrolling => scrolling.Enabled(

true).Height("100%")).HtmlAttributes(new { style = "height : 80%;" })

 

 

%>

 

 

<script type="text/javascript">

 

 

function expandFirstRow(grid, row) { if (grid.$rows().index(row) == 0) { grid.expandRow(row); } }

 

 

 

function activities_onRowDataBound(e) { var grid = $(this).data('tGrid'); expandFirstRow(grid, e.row); }

 

 

 

</script>

 

<%

Html.Telerik().ScriptRegistrar().Render();

 

%>



And i am trying to use some other Jquery libraries inside the page, But it does not work.
If i try to use:

 Html.Telerik().ScriptRegistrar().jQuery(false).Render();

Then my "expand" feature stops working. Any ideas?

Thanks!
Tags
General Discussions
Asked by
Jose Montero
Top achievements
Rank 1
Share this question
or