Telerik Forums
Kendo UI for jQuery Forum
3 answers
291 views
Hi, I'm wondering why I can't get the reference of my kendo menu. The code is wrapped inside a document ready of jquery.

var menu = $("#menu").data("kendoMenu");
 
        menu.bind("select", function (e) {
            var menuItemHeader = $('#menu li').first();
            var menuItemHeaderValue = $(menuItemHeader).find('.k-link').text();
 
            alert(menuItemHeaderValue);
        });

Firebug is saying that my "menu" is undefined but when I inspect the $('#menu'), I'm seeing some kendo events and properties.
Did I miss something?
Dimo
Telerik team
 answered on 03 Oct 2012
1 answer
8.4K+ views
How do I get the selected index of a DropDownList?  I don't see anything in the API docs.
Hari
Top achievements
Rank 1
 answered on 03 Oct 2012
1 answer
195 views
Hi Everyone.

I'm trying to use the Kendo TreeView and I'm having absolutely no luck binding to a local data source. I have a simple asp.net web forms page and I copied and pasted the code from the online demos, but nothing I do will get this working. Any ideas?

<head runat="server">
    <title>Kendo TreeView Demo</title>
    <link href="styles/kendo/kendo.common.min.css" rel="stylesheet" />
    <link href="styles/kendo/kendo.default.min.css" rel="stylesheet" />
    <style type="text/css">
        * { font-family: "Segoe UI", Arial, Helvetica, Sans-Serif; font-size: 12px; }
    </style>
    <script type="text/javascript" src="scripts/jquery.min.js"></script>
    <script type="text/javascript" src="scripts/kendo/kendo.all.min.js"></script>
    <script type="text/javascript" src="scripts/kendo/kendo.data.min.js"></script> 
    <script type="text/javascript">
        $(document).ready(function ()
        {
            var inlineDefault = new kendo.data.HierarchicalDataSource(
            {
                data:
                [
                    {
                        text: "Furniture",
                        items:
                        [
                            { text: "Tables & Chairs" },
                            { text: "Sofas" },
                            { text: "Occasional Furniture" }
                        ]
                    },
                    {
                        text: "Decor",
                        items:
                        [
                            { text: "Bed Linen" },
                            { text: "Curtains & Blinds" },
                            { text: "Carpets" }
                        ]
                    }
                ]
            });
 
            $("#treeview-left").kendoTreeView(
            {
                dataSource: inlineDefault
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div id="treeview-left"></div>
    </div>
    </form>
</body>
</html>
Alex Gyoshev
Telerik team
 answered on 03 Oct 2012
0 answers
118 views
How to set the Pager position on top in Kendo Grid.
Thanks
Muthu
Top achievements
Rank 1
 asked on 03 Oct 2012
0 answers
236 views
Hi All,

I found out strange behavior when placing Kendo treeview which contain icons inside PanelBar.
The icon alignment is not same horizon with the node's text.
However when I place the treeview outside the PanelBar, it behave correctly.
This behavior is not an issue in previous version of Telerik Extensions for ASP.NET MVC.
Anand Chua
Top achievements
Rank 1
 asked on 03 Oct 2012
1 answer
83 views
Hi,

When I add new, the model look like this.

models=%5B%7B%22ProductID%22%3Anull%2C%22ProductName%22%3A%22Fx%22%7D%5D
I would like to serial it into JSON.

How to access those models?

MVC 4 web apis.
Best,
WP

Weera
Top achievements
Rank 1
 answered on 03 Oct 2012
1 answer
143 views
I have a grid with all column widths set. On browsers other than IE 7, when the grid is wider than the combined set width of all the columns, the header columns and body columns expand to fit the entire horizontal space. On IE 7, only the header columns expand while the body columns do not.
Weera
Top achievements
Rank 1
 answered on 03 Oct 2012
0 answers
279 views
good morning everyone,

i am currently using a licensed version of Kendo UI Complete for ASP.NET MVC (Q2 2012)  and trying to render the checkboxes for the TreeView.  I am using the TreeView wrapper for MVC.  I am looking at the example on the demos kendo UI site and something doesn't look right in the example.

the demo site is at:  http://demos.kendoui.com/web/treeview/checkboxes.html

Does the Kendo UI TreeView Wrapper, have a method called "Checkboxes"???  because this would really help my situation right now.  The version of my Kendo UI Wrapper, doesn't seem to have the "Checkboxes" method.  I am trying to achieve the same checkbox functionality like how it is on the demo site:  http://demos.kendoui.com/web/treeview/checkboxes.html

I have attached a screenshot of what i saw on the demo site and below is the sample demo code out there for the public to look at, as reference.  

@(Html.Kendo().TreeView()
                .Name("treeview")
                .Checkboxes(checkboxes => checkboxes
                    .CheckChildren(true)
                )
                .Items(treeview =>
                {
                    treeview.Add().Text("Furniture").Id("1")
                        .Expanded(true)
                        .Items(furniture =>
                        {
                            furniture.Add().Text("Tables & Chairs").Id("2");
                            furniture.Add().Text("Sofas").Id("3");
                            furniture.Add().Text("Occasional Furniture").Id("4");
                        });
 
                    treeview.Add().Text("Decor").Id("5")
                        .Expanded(true)
                        .Items(furniture =>
                        {
                            furniture.Add().Text("Bed Linen").Id("6");
                            furniture.Add().Text("Curtains & Blinds").Id("7");
                            furniture.Add().Text("Carpets").Id("8");
                        });
                })
            )

When I tried to use the above code with my version of the Kendo UI Treeview wrapper, i get an error with the "Checkboxes" method.

@(Html.Kendo().TreeView()
                    .Name("Blah")
                    .Checkboxes( checkbox =>
                    {
                    })
                    .DataSource( dataSource =>
                    {
                    })
                )


Also, it seems that the datasource for checkboxes.cshtml and checkboxes.html examples on the demo site, are different.

Thank you very much
Sam
Top achievements
Rank 1
 asked on 03 Oct 2012
0 answers
79 views
Hi,



    How do I get parameter set ajax request in asp.net?
Renato
Top achievements
Rank 1
 asked on 02 Oct 2012
3 answers
205 views
I'm trying to display details in a grid, but when I put breakpoints in the controller, the app is ignoring the .Read and never hits the controller after the initial load of the page.

Here's my Index.cshtml:

@functions {

    private void AccountGridCommandDef(GridColumnFactory<PosPayAndBankRec.Models.AccountListItem> columns)
 {
  columns.Command(command => { command.Edit(); command.Destroy(); }).Width(180);
        columns.Bound(p => p.AccountID).Hidden();
        columns.Bound(p => p.SourceName).Title("Source");
        columns.Bound(p => p.BankName).Title("Bank");
        columns.Bound(p => p.AccountName).Title("Account");
        columns.Bound(p => p.AccountNumber).Title("Acct #");
        columns.Bound(p => p.AccountFolderName).Title("Folder");
        columns.Bound(p => p.RamQuestBankNumber).Title("Bank #");
        //columns.ForeignKey(p => p.AccountID, (IEnumerable<ORTAccount>)ViewBag.Accounts, "AccountID", "AccountName");
 }

 private void AccountGridDataSource(DataSourceBuilder<PosPayAndBankRec.Models.AccountListItem> dataSource)
 {
        dataSource.Ajax()
            .Model(AjaxDataSourceBuilder)
            .Sort(sort => sort.Add(p => p.BankName))
            .ServerOperation(true)
            .Create(create => create.Action("Create", "Account"))
            .Read(read => read.Action("Read", "Account"))
            .Update(update => update.Action("Update", "Account"))
            .Destroy(destroy => destroy.Action("Delete", "Account"));
            //.Events(e => e.Error("error"));
 }

 private void AjaxDataSourceBuilder(DataSourceModelDescriptorFactory<PosPayAndBankRec.Models.AccountListItem> model)
 {
        model.Id(p => p.AccountID);
        model.Field(p => p.AccountName);
 }

 private void AccountGridToolBarDef(GridToolBarCommandFactory<PosPayAndBankRec.Models.AccountListItem> toolbar)
 {
  toolbar.Create().Text("New Account");
 }
}

@{ ViewBag.Title = "Accounts"; }
@(Html.Kendo().Grid<PosPayAndBankRec.Models.AccountListItem>()
 .Name("Accounts")
 .Columns(AccountGridCommandDef)
 .DataSource(AccountGridDataSource)
        .ToolBar(AccountGridToolBarDef)
        .Editable(c => c.Mode(GridEditMode.PopUp).Enabled(true).DisplayDeleteConfirmation(true).Window(window => window.Title("Account")).TemplateName("AccountPopup").AdditionalViewData(new { Sources = Model.Sources, Banks = Model.Banks }))
 .Sortable()
    .ClientDetailTemplateId("AccountDetails")
 .Pageable(p => p.Enabled(false))
 .Scrollable(s => { s.Height(375); s.Virtual(true); })
)

     

<script id="AccountDetails" type="text/kendo-tmpl">
    @(Html.Kendo().TabStrip()
            .Name("TabStrip_#=AccountID#")
            .SelectedIndex(0)
            .Items(items =>
                       {
                           items.Add().Text("Details").Content(
                               @<text>
                    @(Html.Kendo().Grid<PosPayAndBankRec.Models.AccountListItem>()
                            .Name("Details_#=AccountID#")
                            .Columns(columns =>
                                        {
                                            columns.Bound(p => p.BankAccountName).Width(101);
                                            columns.Bound(p => p.RamQuestDatabaseName).Width(140);
                                            columns.Bound(p => p.RamQuestBankNumberStacked).Width(200);
                                            columns.Bound(p => p.AccountNotes).Width(200);
                                        })
                            .DataSource(dataSource => dataSource
                                                        .Ajax()
                                                        .Read(read => read.Action("Details", "Account", new {id = "#=AccountID#"}))
                            )
                            .Pageable()
                            .Sortable()
                            .ToClientTemplate())
                </text>);




Here's my AccountController.cs:

using System.Linq;
using System.Linq.Expressions;
using System.Web;
using System.Web.Mvc;
using PosPayAndBankRec.Domain.Models;
using System.Data.Entity;
using PosPayAndBankRec.Models;
using System.Data.Entity.Validation;
using Kendo.Mvc.UI;
using Kendo.Mvc.Extensions;

namespace PosPayAndBankRec.Controllers
{
    public class AccountController : BaseController
    {
        private EFTDBContext db = new EFTDBContext();

        public ActionResult Read([DataSourceRequest] DataSourceRequest request)
        {
            var ortaccounts = (from account in db.ORTAccounts
                              join source in db.ORTSources on account.SourceID equals source.SourceID
                              join bank in db.ORTBanks on account.BankID equals bank.BankID
                              select new AccountListItem()
                              {
                                  AccountID = account.AccountID,
                                  BankID = account.BankID,
                                  SourceID = account.SourceID,
                                  AccountName = account.AccountName,
                                  AccountNumber = account.AccountNumber,
                                  AccountFolderName = account.AccountFolderName,
                                  BankAccountName = account.BankAccountName,
                                  BankName = bank.BankName,
                                  RamQuestBankNumber = account.RamQuestBankNumber,
                                  SourceName = source.SourceName,
                                  RamQuestDatabaseName = account.RamQuestDatabaseName,
                                  RamQuestBankNumberStacked = account.RamQuestBankNumberStacked,
                                  AccountNotes = account.AccountNotes
                              }).ToDataSourceResult(request);

            //var sources = db.ORTSources.ToDataSourceResult(request);
            //var banks = db.ORTBanks.ToDataSourceResult(request);

            //return View(viewData);
            return Json(ortaccounts, JsonRequestBehavior.AllowGet);
        }

        [HttpGet]
        public ActionResult Details(int id)
        {
            var ortaccounts = from account in db.ORTAccounts
                              join source in db.ORTSources on account.SourceID equals source.SourceID
                              join bank in db.ORTBanks on account.BankID equals bank.BankID
                              where account.AccountID == id

                             select new AccountDetailsModel()
                              {
                                  AccountID = account.AccountID,
                                  AccountFolderName = account.AccountFolderName,
                                  AccountName = account.AccountName,
                                  AccountNumber = account.AccountNumber,
                                  BankID = account.BankID,
                                  BankName = bank.BankName,
                                  RamQuestBankNumber = account.RamQuestBankNumber,
                                  SourceName = source.SourceName,
                                  AccountNotes = account.AccountNotes,
                                  BankAccountName = account.BankAccountName,
                                  RamQuestDatabaseName = account.RamQuestDatabaseName,
                                  RamQuestBankNumberStacked = account.RamQuestBankNumberStacked
                              };
            var ortaccount = ortaccounts.FirstOrDefault();
            if (ortaccounts == null)
            {
                return RedirectToAction("Error");
            }
            else
            {
                return View(ortaccount);
            }
        }

Alex
Top achievements
Rank 1
 answered on 02 Oct 2012
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Drag and Drop
Application
Map
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
DropDownTree
ListBox
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
Styling
ColorPicker
Pager
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
Licensing
PivotGridV2
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?