Telerik Forums
UI for ASP.NET MVC Forum
2 answers
941 views

Hi Team,

I am working on a Client-Side paging grid (ServerOperation(false)). However, the web still send a request to the server when I click the paging and sorting button. Also, the filter doesn't work. I can see the filter icon, but when I click on it, nothing happens.

My view:

@model IEnumerable<INSYNC_Test.Models.Staffs>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

@(Html.Kendo().Grid(Model).Name("staffs").Columns(c =>
{
    c.Bound(p => p.Firstname);
    c.Bound(p => p.Lastname);
    c.Bound(p => p.JobTitle);

})
.DataSource(d=>d
.Ajax()
.ServerOperation(false)
)
.Pageable()
.Filterable()
.Sortable()
)

 

 

My controller:

using INSYNC_Test.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace INSYNC_Test.Controllers
{
    public class testController : Controller
    {
        // GET: test
        public ActionResult Index()
        {
            var db = new OSHODSEntities();
            var staffs = db.Staffs.Select(p => new Models.Staffs
            {
                ID = p.ID,
                Firstname = p.Firstname,
                Lastname = p.Lastname,
                JobTitle = p.JobTitle,
                locat = p.locat,
                dept = p.dept,
                status = p.status,

            });
            return View(staffs);
        }
    }
}

 

my viewmodel:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace INSYNC_Test.Models
{
    public class Staffs
    {
        public int ID { get; set; }
        public string Firstname { get; set; }
        public string Lastname { get; set; }
        public string JobTitle { get; set; }
        public string locat { get; set; }
        public string dept { get; set; }
        public int status { get; set; }
    }
}

Vince
Top achievements
Rank 1
 answered on 06 Jan 2017
9 answers
4.4K+ views
I've got a kendo grid with an image near it that will act like a button. When pressed, it will call a controller method. I want to send the selected row data to that method.

**VIEW**

<a href="#" id="ic_open" class="tooltip2" title="Abrir">
    <span title="">
        <img class="toolbar-icons" src="../../Images/open.png"/>
    </span>
</a>
...
<div id="datagrid">
    @(Html.Kendo().Grid(Model)
        .Name("datagrid_Concessoes")
        .Columns(columns =>
        {
            columns.Bound(c => c.Id).Width(70);
            columns.Bound(c => c.Code);
            columns.Bound(c => c.Description);
            columns.Bound(c => c.CreationDate);
            columns.Bound(c => c.CreationUser);
        })
        .HtmlAttributes(new { style = "height: 534px;" })
        .Scrollable()
        .Sortable()
        .Selectable()
        .Pageable(pageable => pageable
            .Refresh(true)
            .ButtonCount(5))
        .DataSource(dataSource => dataSource
            .Ajax()
            .PageSize(15)
            .Read(read => read.Action("GetConcessoes", "MasterData"))
        )
    )
</div>


And the **script**:

<script type="text/javascript">
 
    $(function () {
 
        $('.tooltip2').click(function () {
 
            var id = this.id;
 
            $.get('@Url.Content("GetPartialView")',
            { "id": id },
            function (data) {
                $('#div-for-partial').html(data);
            });
 
        });
    });
 
</script>

This script sends the link's id (ic_open) to the controller successfully. I want to send the selected row data, via this same function or some other (doesn't matter), to the controller so I can manipulate that info.

CONTROLLER METHOD

public ActionResult GetPartialView(string id)
{
    switch (id)
    {
        case "":
            return PartialView("_Concessoes");
        case "tab1":
            return PartialView("_Concessoes");
        case "tab2":
            return PartialView("_AutoEstradas");
        case "ic_open":
            return PartialView("_NovaConcessao");
 
    }
 
    return RedirectToAction("Index");
 
}

Any help?
Thanks
Dimiter Madjarov
Telerik team
 answered on 06 Jan 2017
1 answer
158 views

I have a form with multiple combo boxes, all have the same OnSelect event.

When I call the OnSelect I need to determine which combo box actually fired the event.

 

Here is my OnSelect function...

function combo_OnSelect(e) {
        var dataItem = this.dataItem(e.item.index());
        var control =  $(this).val();
        if (dataItem.Value == "Lookup") {
            var dialog = $("#window_Lookup").data("kendoWindow")
            dialog.center().open();
        }
    }

The bolded part throws an error, so what is the correct way to determine the combo box name?

Ivan Danchev
Telerik team
 answered on 05 Jan 2017
12 answers
255 views

Hi Support Team,

I created a series starting on 2016/1/1 recurrence rule "daily" and repeat every 3 days. January and February are OK.

But in march ​there is an entry on 2016/3/28 and 2016/3/29.

When I change the series to repeat every 4 days the last correct entry is 2016/3/25. The next entry is on 2016/3/30.

This seems to be a general problem in daily recurrence.

Is there a hot-fix?

Regards, David

 

Dimitar
Telerik team
 answered on 05 Jan 2017
3 answers
119 views
When I use TimePicker it shows NaN on Mac but work perfect on Windows PC
Kiril Nikolov
Telerik team
 answered on 04 Jan 2017
2 answers
1.0K+ views

Hi,

 

I have a checkbox that should have a tooltip, but the tooltip never shows. Can you help me find what I am doing wrong? KeepComputer is (of course) a boolean.

            <tr>
                <td>@Html.Kendo().CheckBoxFor(m => m.KeepAccessBadge)</td>
                @Html.Kendo().Tooltip().For("#KeepAccessBadge").Content("Something...")
            </tr>

On other elements I have identical tooltips and they are working just as expected.

 

Henrik
Top achievements
Rank 1
 answered on 04 Jan 2017
1 answer
56 views

Is there a work around for select all items in a Autocomplete text box?

Thanks in advance!

Nencho
Telerik team
 answered on 03 Jan 2017
3 answers
116 views

I'm developing a UI where the user can select from n stored procedures and view a chart for the resulting data. I need to develop a way to allow the user to configure a chart (for now I'm starting simple, bar/column/line chart only). I saw a prior post that said to look into scaffolding. I did, but still can't figure an intuitive way for the user to select the various axis and series. I'm hoping someone can point me to a working demo that allows the user to configure their chart elements.

Thanks in advance!

Steve.

Vessy
Telerik team
 answered on 30 Dec 2016
1 answer
149 views
Outer Grid:
@(Html.Kendo().Grid(Model)
                .Name("assetTypeGrid")
                .Columns(columns =>
                {
                    columns.Bound(a => a.Type).ClientTemplate(@"<img src='/Content/Images/Pins/#:data.Type#' style='height: 32px; weight: 32px;' />").Width(100);
                    columns.Bound(a => a.Description).Title("Name").Width(200);
                    columns.Bound(a => a.Tabs).Title("Available Tab(s)").Width(200);
                    columns.Bound(a => a.AssetTypeId).Title("").Filterable(false).Sortable(false)
                        .ClientTemplate(createLink).Width(100);
                })
                .Sortable()
                .Pageable(pageable => pageable
                .ButtonCount(5))
                .Filterable(ftb => ftb.Mode(GridFilterMode.Row))
                .ClientDetailTemplateId("template")
                .DataSource(dataSource => dataSource
                .Ajax()
                .PageSize(20)
                .ServerOperation(false))
                )
Inner Grid:
<script id="template" type="text/kendo-tmpl">
       @(Html.Kendo().Grid<CIMSDashboard.ViewModels.AssetTemplateViewModel>()
       .Name("grid_#=Name#")
       .Columns(columns =>
       {
           columns.Bound(o => o.Types).Width(110);
           columns.Bound(o => o.Name).Width(110);
           columns.Bound(o => o.Description).Width(110);
       })
 
       .DataSource(dataSource => dataSource
           .Ajax()
           .PageSize(10)
           .Read(read => read.Action("GetAssetTemplates", "AccessRetriever", new { templateName = "Pipe" }))
        )
        .Pageable()
        .Sortable()
        .ToClientTemplate()
       )
   </script>
Script:
<script type="text/javascript">
        $(document).ready(function () {
 
            function dataBound() {
                this.expandRow(this.tbody.find("tr.k-master-row").first());
            }
 
        });
 
    </script>
Read Function:
public static List<AssetTemplateViewModel> GetAssetTemplates(string templateName)
        {
            using (MiniProfiler.Current.Step("Getting Asset template Details"))
            {
                var result = new List<AssetTemplateViewModel>();
                using (var context = ProfiledContext())
                {
                    var query = from ta in context.tblTemplate_Assets
                            join at in context.tblAssetTypes on ta.AssetType equals at.Name
                            join atl in context.tblLink_AssetTypeToTemplate_Assets on ta.keyTempAssetID equals atl.fk_Template_AssetID
                            where atl.fk_AssetType == templateName
                                select new AssetTemplateViewModel()
                                {
                                    Types = at.Logo,
                                    Name = ta.Name,
                                    Description = ta.Description
                                };
 
                    if (query.Any())
                    {
                        foreach (var q in query)
                        {
                            result.Add(q);
                        }
                    }
                }
 
                return result;
            }
        }

 

The above read function is not being called.. am I missing something?? the layout of inner grid is coming perfectly, its all about data is not being displayed.. it is not reaching my break point in AccessRetriver at all...   I've attached pictures of my output.. pls help me. Thank you in advance.

Viktor Tachev
Telerik team
 answered on 30 Dec 2016
2 answers
282 views

The recent update might have changed the behavior of the Grid Filter and their seems a slight bug in hovering of the Kendo Grid Filter TextBox with the Chrome.

 

Our Kendo Grid Deployed with MVC helpers throughout applications is now facing a slight bug in Chrome when we try to filter the grid column, the filter hides immediately as soon as we hover over to Textbox of Filter when default operator is not changed. If the operator is changed than the popup of the filer stays without any problem. The user has to use the Tab key enter the info in to the TextBox.

 

This Problem is not happening in Firefox but only Chrome.

 

The KendoMVC.dll version is 2016.3.914.545

Chrome version is Version 55.0.2883.87 m (64-bit)

 

Any Solution to this problem will be greatly appreciated.

 

Dev
Top achievements
Rank 1
 answered on 29 Dec 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?