Load MVC view to jquery color box
You can use the following set of code to load a MVC view to a jquery color box.
You can get more details on jquery colobox here.
HTML code
- <table cellpadding="0" cellspacing="0" border="0" class="display" id="ClientConfigurationList" style="width: 100%" >
- <thead>
- <tr>
- <th>Work Order No</th>
- <th>Work Order Status</th>
- <th>Created On</th>
- <th>Completed On</th>
- <th>Asset Description</th>
- </tr>
- </thead>
- <tbody>
- @foreach (var item in Model)
- {
- <tr class="leftAlign">
- <td>
- <a href="#DIV_WorkOrderDetailsContent" onclick="new WorkOrderManagement().ViewWorkOrderDetails(@item.Id)" class="colorbox">@Html.DisplayFor(modelItem => item.WorkOrderNo)</a>
- </td>
- <td class="leftAlign">
- @Html.DisplayFor(modelItem => item.WorkOrderStatus)
- </td>
- <td>
- @Html.DisplayFor(modelItem => item.CreatedOn)
- </td>
- <td>
- @Html.DisplayFor(modelItem => item.CompletedOn)
- </td>
- <td>
- @Html.DisplayFor(modelItem => item.AssetDescription)
- </td>
- </tr>
- }
- </tbody>
- </table>
Javascript Code
- this.ViewWorkOrderDetails = function (workOrderId) {
- debugger;
- $('#DIV_WorkOrderDetailsContent').html($("#DIV_WorkOrderDetailsLoadingMessage").html());
- $('#DIV_WorkOrderDetailsContent').load("/Workorder/WorkOrderDetails?workOrderId=" + workOrderId, new function () { });
- $('.colorbox').colorbox({ inline: true, height: "80%", width: "50%" });
- };
Happy Coding !!!!!!!!
hiiiiiii....nice yr
ReplyDeletehey ping me on 8050986500 whtsapp i feel u can help me lot.. ur knowledge is useful for others..if u feel shy and having problm in whtsapp then contact me on gmail..nitingupta050@gmail.com
Delete