0

Here i m passing only single param from telerik to javascript function. i need to pass another param also

 <a href="javascript:void(0);" onclick="AddOdometer(<%: b.VehicleRepositoryId %>)"
            title="ADDTrip" id="A1">Add Distance</a>

whole code for reference

 <% Html.Telerik().Grid(Model.VehicleList)
                                .Name("VehiclesRepositoryGrid")
                                    .Columns(colums =>
                                    {
                                        colums.Bound(b => b.TruckNumber).Title("Vehicle Number")
                                            .FooterTemplate(() =>
                       {%>
        Total:
        <%})
                        .Width(100);
                                        colums.Bound(b => b.Month);
                                        colums.Bound(b => b.FuelType).Title("Fuel Type");
                                        colums.Bound(b => b.TotalDistance).Title("Distance")
                        .FooterTemplate(() =>
                        {%>
        <%= Model.VehicleList.Sum(v=>v.TotalDistance)%>
        <%})
                        .Width(100);
                                        colums.Bound(b => b.TotalFuel).Title("Fuel")
                                             .FooterTemplate(() =>
                       {%>
        <%= Model.VehicleList.Sum(v => v.TotalFuel)%>
        <%})
                        .Width(100);
                                        colums.Bound(b => b.Mileage);

                                        colums.Template(b =>
                                          {
        %>
        <% if (b.TotalDistance == 0)
           {%>
        <a href="javascript:void(0);" onclick="AddOdometer(<%: b.VehicleRepositoryId %>)"
            title="ADDTrip" id="A1">Add Distance</a>
        <%}
           else
           { %>
        <a href="javascript:void(0);" onclick="EditOdometer(<%: b.VehicleRepositoryId %>)"
            title="Edit">
            <img src="<%= ResolveUrl("~/Content/Images/Edit.gif")%>" alt="Edit" title="Edit"
                class="vaM" /></a> | <a href="javascript:void(0);" onclick="DeleteOdometer(<%: b.VehicleRepositoryId %>)"
                    id="DeleteVehicle">
                    <img src="<%= ResolveUrl("~/Content/Images/Delete.gif")%>" alt="Delete" title="Delete"
                        class="vaM" /></a>
        <% } %>
        <%
                                          }).Title("Actions")
            .Width(100).HtmlAttributes(new { @class = "taC" });
                                    })
                                     .Groupable(settings => settings.Groups(groups =>
                                     {
                                         groups.Add(o => o.TruckNumber);
                                         if (ViewData["Grouping"] != null)
                                         {
                                             groups.Add(o => o.Month);
                                         }
                                     }))
                                    .Scrollable(scrolling => scrolling.Enabled(false))
                                    .Sortable(sorting => sorting.Enabled(true))
                                    .Pageable(paging => paging.Enabled(true))
                                    .Filterable(filtering => filtering.Enabled(true))
                                    .Footer(true)
                                    .Render();
        %>

1 Answer 1

1

Not sure what your question is, is this what you want to achieve?

 <a href="javascript:void(0);" 
    onclick="AddOdometer(<%: b.VehicleRepositoryId %>, <%: b.SecondParam %>)"
    title="ADDTrip" id="A1">Add Distance</a>
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.