Telerik Forums
Kendo UI for jQuery Forum
15 answers
1.2K+ views
Hi. When looking at the basic example for the Scheduler (Scheduler basic usage), there is an example of how to apply a filter for the datasource. In my Scheduler, I'm binding the resources to a datasource, but when trying to apply the filter in javascript (like in the example for the main datasource filter), it is not working.
scheduler.resources.datasource.filter(filter);
Do anyone have an example for how to do this? Is it possible at all?
Alexander
Top achievements
Rank 1
 answered on 06 Sep 2013
1 answer
100 views
Hello,
I'm currently trying to develop a menu binding the data from the datasource.... I've folowed your example at http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/menu/overview

but I'm not able to load the children
@(Html.Kendo().Menu().Name("menu").BindTo(Model, mappings =>
    {
        mappings.For<IDEA20.DO.Common.MenuItem>(binding =>
            {
                binding.ItemDataBound((item, category) => //define mapping between menu item properties and the model properties
                            {
                                item.Text = category.Text;
                                 
                            }).Children(category => category.SubMenu);
            });
 
    })
     )
My MenuItem is of type

public class MenuItem
{
    public MenuItem()
    {
        SubMenu = new List<MenuItem>();
    }
 
    public string Text { get; set; }
    public string Controller { get; set; }           
    public string Action { get; set; }
    public bool Selected { get; set; }
 
    public List<MenuItem> SubMenu { get; private set; }
}
What am I doing wrong? It only shows the first, it puts the arrow for opening but won't open...

Thanks
Paolo

Georgi Krustev
Telerik team
 answered on 06 Sep 2013
1 answer
584 views
Hi - I would like to set the Max value on the valueAxis for two charts to the same value.  I want to use the max value found, and it won't always be the same or even on the same chart.  The charts sit side-by-side on my page and having the max be different can be misleading for our customers.  Attached is a screen shot showing what I mean.  In this case, I'd want the max to be either 43.36, or better yet rounded up to 50, for both charts, since that's the largest value I have.

Is there a way to do this?  I can of course hard-code a value, but we get quite a range depending on what the users pick to look at.

Thanks

Lisa
T. Tsonev
Telerik team
 answered on 06 Sep 2013
1 answer
93 views
Hi, Is there a way to implement listview with isotope to rpovide animation?

thanks
Nikolay Rusev
Telerik team
 answered on 06 Sep 2013
3 answers
122 views
I like how the Kendo Mobile listview remembers its place during page transitions...this is something that jQuery mobile does NOT have.  What's weird, however, is when I change the orientation, if I have scrolled down a little on the listview, it will return me to the top of the page.  I am on the flat UI.  Is there any way to fix this?
Kiril Nikolov
Telerik team
 answered on 06 Sep 2013
1 answer
446 views
So, we're evaluating Kendo UI against Dev Express for our next version of Oliver.  Thought I'd test forum support as well!  

I'm having a problem getting my tree view to display folders (rather than the default >).  Probably something simple.  Here's the MVC wrapper - note it's a treeview in a panel:

@(Html.Kendo().PanelBar()
    .Name("panelbar")
    .ExpandMode(PanelBarExpandMode.Single)
    .Items(panelbar =>
    {
        panelbar.Add().Text("Folders")
            .Content(@<text>
            <div id="folderTreeView">
                @(Html.Kendo().TreeView()
                    .Name("treeview")
                    .DataTextField("text")
                    .LoadOnDemand(true)
                    .DataSource(source => 
                        source.Read(read =>
                            read.Action("GetFolders", "documents")
                        )
                    )
                    .Events( events => events
                        .Select( "onTreeItemSelect" )
                    )
                    .Deferred()
                )
            </div>
            </text>);
        panelbar.Add().Text("Batches").Content("Batches? We 'aint got no batches. I don't gotta show you no stinkin' batches!");
        panelbar.Add().Text("Clusters");
        panelbar.Add().Text("Tags");
        panelbar.Add().Text("Exemplars");   

    })
    .Deferred()
)
 
Here's the ajax handler:
        public List<DocTreeItem> GetFolders(int? id)
        {
            if (!id.HasValue)
                id = 0;

            List<DocTreeItem> folders = (from docFolders in _dataContextFactory.OliverDBContext.GetTable<FolderTree>()
                                            where docFolders.ParentFolderId == id 
                                            select new DocTreeItem()
                                            {
                                                id = docFolders.FolderId,
                                                text = docFolders.FolderName + " (" + docFolders.DocCount.ToString() + ")",
                                                hasChildren = docFolders.HasChildren,
                                                spriteCssClasses ="folder"
                                            }).ToList();
            return folders;
        }

where DocTreeItem is:
    public class DocTreeItem
    {
        public int id { get; set; }
        public string text { get; set; }
        public bool hasChildren { get; set; }
        public string spriteCssClasses { get; set; }
    }

What am I doing wrong?  Note, I have to define DocTreeItem instead of using Kendo.TreeViewItem because of a problem with camelCase:  If I return a list of TreeViewItems, kendo js is expecting them in camel case.  But, when I enable camel case via: config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); my grid controls break because the grid model binds to the non-camel case model definition, but when it goes to bind on the client, the ajax call now is sending camel case and so the grid won't find it.  How do you deal with that, also?

Thanks,

Robert

Dimiter Madjarov
Telerik team
 answered on 06 Sep 2013
1 answer
37 views
Since $.Browser is deprecated and $.Support doesn't appear to provide a check for supported content types, what's the best way to deliver device specific content types?

Here are some valid examples;
Flash based content to desktop systems, alternate content to iPads. (Please no flames on Flash, it still has valid uses).

Ad-hoc iPad app installs where you would need an install link for iPad and a download link for other browsers.

This is what I'm currently using;

var agentMatch = navigator.userAgent.match(/(iPhone|iPod|iPad)/);
 window.is_AppleMobile = (typeof(agentMatch) === 'undefined') || (agentMatch === null)?false:true;

Any thoughts?

Kiril Nikolov
Telerik team
 answered on 06 Sep 2013
1 answer
84 views
Hello

I have script manager in my page and am using kendoGrid. I am connecting the grid to the service. When this code runs I get the following error:
SCRIPT5007: Unable to get property 'length' of undefined or null reference
ScriptResource.axd, line 5 character 5907
I've checked the script manager code it is with the endWith, (String.prototype.endsWith=function(a){return this.substr(this.length-a.length)===a})

Thank you for your help
Below is the script used
 
$(document).ready(function () { Sys.Application.add_load(initContactsPage); });
var contactsGrid = null;
function initContactsPage()
{
    var contactsColumns = [{
        field: "CustomerName",
        title: "Name",
        template: '<a class="name" href="ContactDetails.aspx?Id=#=CustomerID#">#=CustomerName#</a>'
    },
    {
        field: "strCustomerNumber",
        title: "Number"
    },
    {
        field: "strMainPhone",
        title: "Phone"
    },
    {
        field: "strCity",
        title: "City"
    },
    {
        field: "strWebsite",
        title: "Web Site"
    }
    ];
    contactsGrid = $("#gvContacts").kendoGrid({
        columns: contactsColumns,
        dataSource: new kendo.data.DataSource({
            pageSize: 10, serverPaging: true, page: 1,
            schema:
                {
                    total: "VirtualTotal",
                    data: "Records"
                },
            transport:
                {
                    read:
                    {
                        url: "/Services/APIService.asmx/ListObjectRecords",
                        type: "POST",
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        data: getData()
                    }
                },
            error: function (e)
            {
 
            }
        }),
        groupable: false,
        scrollable: false,
        pageable: true
    }).data("kendoGrid");
}
function searchContacts(page)
{
    contactsGrid.dataSource.page(1);
}
function getData()
{
    var contactsParams = {};
    contactsParams["objectId"] = "C9D9AEC9-F6C2-4EB3-8F00-D32A45A7C4C7";
    contactsParams["textFilter"] = null;
    contactsParams["sortColumn"] = null;
    contactsParams["startIndex"] = 1;
    contactsParams["pageSize"] = 10;
    return JSON.stringify(contactsParams);
}
Alexander Valchev
Telerik team
 answered on 06 Sep 2013
1 answer
117 views
The dataBound event can be wired up by data attribute but dataBinding cannot. Why?
<ul data-role="listview" data-bind="source: exampleData" data-binding="onDataBinding" data-bound="onDataBound"></ul>
<script type="text/javascript">
    function onDataBound (e) {
        console.log("this works");
    }
    function onDataBinding (e) {
        console.log("this doesn't");
    }
</script>
Alexander Valchev
Telerik team
 answered on 06 Sep 2013
2 answers
513 views
Hi , 

I have a Model which have a complex structure/nested objects.
Account object have child objects called Addresses. 

Like Account.Addresses[0].StreetName etc.

How can i set Addresses from editor popup custom template so i get the list from controller to update or insert.

My Controller : 
[HttpPost]
      public ActionResult AccountPopup_Create([DataSourceRequest] DataSourceRequest request, Account account )
      {
          var result;
          return new JsonResult() { Data = result };
      }
 
 
      [HttpPost]
      public ActionResult AccountPopup_Update([DataSourceRequest] DataSourceRequest request, Account account )
      {
          var result;
          return new JsonResult() { Data = result };
      }
My custom Template :

@model  Account
 
 
<table>
    <tr class="nameEditor">
        <td class="editor-label">Dosya Adı
        </td>
        <td class="editor-field">
            @Html.TextBoxFor(model => model.Name, new { disabled = "disabled" })
        </td>
    </tr>
    <tr class="nameEditor">
        <td class="editor-label">Kaynak Adı
        </td>
        <td class="editor-field">
            @Html.DropDownListFor(model => model.SourceId, new SelectList(GetSources(), "IntId", "Name"), new { disabled = "disabled" })
        </td>
    </tr>
    <tr class="nameEditor">
        <td class="editor-label">Kaynak Profil Id
        </td>
        <td class="editor-field">
            @Html.TextBoxFor(model => model.SourceAccountId, new { disabled = "disabled" })
        </td>
    </tr>
    <tr class="nameEditor">
        <td class="editor-label">Vergi Dairesi
        </td>
        <td class="editor-field">
            @Html.TextBoxFor(model => model.TaxOffice, new { disabled = "disabled" })
        </td>
    </tr>
    <tr class="nameEditor">
        <td class="editor-label">Vergi Numarası
        </td>
        <td class="editor-field">
            @Html.TextBoxFor(model => model.TaxNo, new { disabled = "disabled" })
        </td>
    </tr>
    <tr class="nameEditor">
        <td class="editor-label">Web Sitesi
        </td>
        <td class="editor-field">
            @Html.TextBoxFor(model => model.Website, new { disabled = "disabled" })
        </td>
    </tr>
 
    <tr class="nameEditor">
        <td class="editor-label">E-Posta
        </td>
        <td class="editor-field">
            @Html.TextBoxFor(model => model.EMail, new { disabled = "disabled" })
        </td>
    </tr>
    <tr class="nameEditor">
        <td class="editor-label">Telefon Numarası
        </td>
        <td class="editor-field">
            @Html.TextBoxFor(model => model.Tel, new { disabled = "disabled" })
        </td>
    </tr>
    <tr class="nameEditor">
        <td class="editor-label">Fax
        </td>
        <td class="editor-field">
            @Html.TextBoxFor(model => model.Fax, new { disabled = "disabled" })
        </td>
    </tr>
    <tr class="nameEditor">
        <td class="editor-label">Profil ÇeÅŸidi
        </td>
        <td class="editor-field">
            @Html.DropDownListFor(model => model.AccountType, new SelectList(ConfigModel.EnumToSelectList(typeof(AccountType)), "Value", "Text"), new { disabled = "disabled" })
        </td>
    </tr>
    <tr class="nameEditor">
        <td class="editor-label">Senaryo Tipi
        </td>
        <td class="editor-field">
            @Html.DropDownListFor(model => model.ScenarioType, new SelectList(ConfigModel.EnumToSelectList(typeof(ScenarioType)), "Value", "Text"))
        </td>
    </tr>
    <tr>
        <td colspan="2" style="height: 10px;"></td>
    </tr>
    <tr>
        <td colspan="2" style="padding-left: 20px;"><strong>Adres</strong></td>
    </tr>
    <tr>
        <td colspan="2" style="height: 10px;"></td>
    </tr>
    <tr class="nameEditor">
        <td class="editor-label">Bina Adı
        </td>
        <td class="editor-field">
            @Html.TextBoxFor(model => model.Addresses[0].CityName)
        </td>
    </tr>
      <tr class="nameEditor">
        <td class="editor-label">Hesap Adı
        </td>
        <td class="editor-field">
            @Html.TextBoxFor(model => model.Addresses[0].AccountId)
        </td>
    </tr>
       
      <tr class="nameEditor">
        <td class="editor-label">Mahalle Adı
        </td>
        <td class="editor-field">
            @Html.TextBoxFor(model => model.Addresses[0].CitySubdivisionName)
        </td>
    </tr>
       
</table>
My Grid :

@(Html.Kendo().Grid(GetAccounts(AccountType.Customer))
      .Name("accountsGrid")
      .Columns(columns =>
      {
          columns.Bound(Account => Account.Name).HeaderTemplate("Profil Adı").Filterable(filterable => filterable.UI("accountNameFilter")).HtmlAttributes(new { title = " #= Name # " });
          columns.Bound(Account => Account.TaxNo).HeaderTemplate("Vergi No").Filterable(filterable => filterable.UI("taxNoFilter")).Width(120);
          columns.ForeignKey(Account => Account.SourceId, GetSources(), "IntId", "Name").Title("Kaynak Adı").Width(200);
          columns.Bound(Account => Account.AccountType).HeaderTemplate("Hesap Tipi").Width(120);
          columns.Command(command => { command.Edit().Text("Güncelle").UpdateText("Güncelle").CancelText("İptal"); }).Width(105);
      })
                   .Filterable(filterable => filterable
                                .Extra(false)
                    )
                   .ToolBar(toolbar => toolbar.Create().Text("Yeni kayit ekle"))
                   .Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("AccountEditPopup"))
                   .Pageable(pager => pager
                   .Messages(messages => messages.Display("{0} - {1}. Toplam {2} kayıt")
                                             .ItemsPerPage("")
                                             .First("İlk sayfa")
                                             .Last("Son sayfa")
                                             .Next("Sonraki")
                                             .Page("Sayfa")
                                             .Previous("Önceki")
                                             .Refresh("Yenile"))
                  )
                  .Sortable()
                  .Scrollable()
                  .Events(e => e.Edit("onEdit"))
                  .ClientDetailTemplateId("template")
                  .DataSource(dataSource => dataSource
                      .Ajax()
                      .PageSize(30)
                      .Model(model =>
                      {
                          model.Id(p => p.IntId);
 
                      })
                      .Events(events => events.Error("error_handler"))
                      .Create(update => update.Action("AccountPopup_Create", "Config"))
                      .Read(read => read.Action("AccountPopup_Read", "Config"))
                      .Update(update => update.Action("AccountPopup_Update", "Config"))
                  )
                                 )
hüseyin altun
Top achievements
Rank 1
 answered on 06 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?