Telerik Forums
Kendo UI for jQuery Forum
10 answers
430 views
I've almost used up my trial time trying to figure out how to get a dropdownlist to show up like the example in:
http://demos.kendoui.com/web/grid/editing-custom.html

I see I'm not the only one struggling to get something that should be pretty simple to work.  The example is missing an explanation of how the template #=Category.CategoryName# works and where to find the definition of that template.  I'd like the see a step-by-step tutorial on how to wire up this control.  I'm sure there are MANY others who would benefit from this as well.

In my demo application I have a database value I'm reading which is an integer which I want displayed as a text in a DropDownList within a grid.  I think I'm close but I'm missing a few key points.  How do I add my own editor template?  The demo seems to suggest it is either in the view or controller for the grid.  I think I found it in the "EditorTemplates" folder but have no idea how it gets connected to the view.  Here are snippets of my project code:

My view:
@model IEnumerable<QT_Kendo2.Models.Isotope>
@{
    ViewBag.Title = "Index";
}
<h2>Isotope Library</h2>
@(Html.Kendo().Grid(Model).Name("Isotopes").Columns(c =>
{
    c.Bound(p => p.Id).Hidden();
    c.Bound(p => p.Version).Hidden();
    c.Bound(p => p.Name);
    c.Bound(p => p.LLD).Format("{0:n1}");
    c.Bound(p => p.ULD).Format("{0:n1}");
    c.Bound(p => p.HalfLife);
    c.Bound(p => p.HalfLife_Units).ClientTemplate("#=HLUnitList#");     // Convert the numeric index into text (hours, days, weeks, years)

    c.Command(command => { command.Edit(); command.Destroy(); });
})
    .ToolBar(toolbar =>
        {
            toolbar.Create();
            //    toolbar.Save();       // Used in batch mode
        })
    //.HtmlAttributes(new { style = "height:400px;" })
    .DataSource(dataSource => dataSource
        .Ajax()
        .ServerOperation(false)
        .Model(model =>
            {
            model.Id(p => p.Id);
            model.Field(p => p.Id).Editable(false);
            })
        .Create(create => create.Action("EditingIsotope_Create", "Isotope"))       // "Insert"
        .Update(update => update.Action("EditingIsotope_Update", "Isotope"))
        .Destroy(destroy => destroy.Action("EditingIsotope_Destroy", "Isotope"))
        .Events(events => events.Error("error_handler"))
     )
    .Pageable()
    .Sortable()
    .Editable(editable => editable.Mode(GridEditMode.InLine))
)
Controller:
namespace QT_Kendo2.Controllers
{
    public class IsotopeController : Controller
    {
        private QT_Db db = new QT_Db();

        public ActionResult Index()
        {
            var hlUnits = new List<string>() {"hours", "days", "weeks", "years"};
            ViewData["hlUnits"] = hlUnits;
            return View(db.Isotopes.ToList());
        }

        public ActionResult EditingCustom_Read([DataSourceRequest] DataSourceRequest request)
        {
            var dsr = new DataSourceResult();
            return Json(dsr);
        }

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult EditingIsotope_Update([DataSourceRequest] DataSourceRequest request, Isotope isotope)
        {
            if (isotope != null && ModelState.IsValid)
            {
                db.Entry(isotope).State = EntityState.Modified;
                db.SaveChanges();
            }
            return Json(ModelState.ToDataSourceResult());
        }

    [AcceptVerbs(HttpVerbs.Post)]
    public ActionResult EditingIsotope_Destroy([DataSourceRequest] DataSourceRequest request, Isotope isotope)
        {
            db.Isotopes.Remove(db.Isotopes.Find(isotope.Id));
            db.SaveChanges();
            return Json(ModelState.ToDataSourceResult());
        }

    [AcceptVerbs(HttpVerbs.Post)]
    public ActionResult EditingIsotope_Create([DataSourceRequest] DataSourceRequest request, Isotope isotope)
        {
            if (ModelState.IsValid)
            {
                db.Isotopes.Add(isotope);
                db.SaveChanges();
            }
            return Json(ModelState.ToDataSourceResult());
        }

EditorTemplates as seen in the demo.  Not sure how to add these to my project.  Just adding as a partial view doesn't work.
@model IEnumerable<QT_Kendo2.Models.Isotope>
@(Html.Kendo().DropDownListFor(m => m)
        .Name("HLUnitList")                                       // Name used by template?  #= HLUnitList
        .DataValueField("HalfLife_Units")               // Name of the index from the model
        .DataTextField("HLUnitList")                        // Name of the template again.
        .BindTo((System.Collections.IEnumerable)ViewData["hlUnits"])      // Bind to the list index to the string list
)

Vladimir Iliev
Telerik team
 answered on 09 Sep 2014
4 answers
667 views
How can I expand all?

I thought I saw some code in this demo to do it, but firebug keeps returning "undefined"

var menucontainer = $("#menu");
 
menucontainer.insertBefore($("#content-wrapper")); //Move the menu
menucontainer.kendoPanelBar(); //Kendo the Menu
 
menucontainer.data("kendoPanelBar").expand($("#menu .k-link"), true);
Masaab
Top achievements
Rank 1
 answered on 09 Sep 2014
2 answers
155 views
Sorry if this isn't the appropriate forum.  I have several elements interacting here as you will see...

Imagine a page with a simple search form and a grid containing the results of the search.  The grid is hidden by default and only shown when needed.

I have a menu that is hidden at the top of the page.  The menu is slid in using kendo.fx().slideIn() when the user clicks a handle (similar to the SlideIn demo, but from the top).  This works perfectly until the search grid is shown.

Once the search grid is shown, it covers up the menu when the menu is also shown (see attached coveredMenu.png).  I've also attached some of the relevant HTML (see attached coveredMenuHtml.png).

Through experimentation, I've determined the following:
  • IE11 and Firefox both exhibit the same behavior.  Haven't tested other browsers.
  • If the menu is not slid in, everything works fine.
  • By playing with paddings, I can see that the element causing the problem is the <div class="k-grid k-widget"> gird container.
  • Playing with z-indexes for the grid and menu makes no difference in this behavior.

So how can I accomplish sliding the menu in without it being covered?

Steve
Top achievements
Rank 1
 answered on 08 Sep 2014
2 answers
179 views
Hello,

I'm using the PivotGrid control with local databinding (the local data might be different, it's some kind of dynamic data so not always there will be the same fields with the same names).

For example, I receive these records where the Year field is:
- 2012
- 2009
- 2010
- 2013
- 2011

But I would like that when I add this Year field to my pivot grid I could read the data like this:
- 2009
- 2010
- 2011
- 2012
- 2013

I have tried using the dataSource sort method, etc. but I cannot achieve this.
Rolf
Top achievements
Rank 1
 answered on 08 Sep 2014
1 answer
119 views
When dataSource has only one item, widget automatically select it, but selected item in MVVM is null. I would expected that this 2 things are synchronize.
demo just click "click for selected value" button.
Georgi Krustev
Telerik team
 answered on 08 Sep 2014
3 answers
247 views
Hi



I’m looking for a specific functionality in gantt chart control. For example: i
have a record where <Summary> property has a "true" value and
it’s a parent container for three particular child operations. By default this
record that i've mentioned above is displaying as  a status progressbar
(percent). But despite / instead of that i’d like to see additional blank
spaces, it means a time periods where is a gap between start/end values.
Bozhidar
Telerik team
 answered on 08 Sep 2014
2 answers
258 views
I added a button on the tab. But I can see that the buttons are not compatible with tabs? Tabs became more height and the button itself does not look beautiful. Does that have to work with the kendo I should have a professional designer css ??



PS: To see problem please press "Add Tab" button on my examle.
PSS: http://prntscr.com/4k9j74 screen
nim
Top achievements
Rank 1
 answered on 08 Sep 2014
1 answer
93 views
Hi,

I have an issue with the filter row when using AngularJS.  When a full reload of the page is done then the filter row is displayed fine but when the view is loaded in (for example using ui-router), the input fields look odd and boolean columns.

See attached
Petur Subev
Telerik team
 answered on 08 Sep 2014
1 answer
248 views
I'm trying to bind kendoAutoComplete to a text element inside the editor template, which I'm doing by inlining some jquery. What I'm finding, though is that the html element appears not to have been rendered into the page at the point where the jquery is running.

<script id="editor" type="text/x-kendo-template">
        <input id="test" type="text" name="client_name" class="form-control" />
        #$('\#test').kendoAutoComplete(["Item1", "Item2", "Item3"]);#
</script>
So the binding doesn't work.

Is there some way i can do this via an mvvm attribute, or some other way of synchronising the javascript so that I can guarantee the html is rendered at the time when the js is running?

Cheers, Paul.
Daniel
Telerik team
 answered on 08 Sep 2014
6 answers
180 views
Hi
  Apologies in advance if this is documented somewhere.

Do you support Windows tablets, specifically Windows RT and Windows Pro?

I was surprised to find the menu didn't work in IE in desktop or metro mode on windows tablets without a mouse

http://demos.telerik.com/kendo-ui/menu/index

Normally you hover with the mouse to see a dropdown but clicking didn't do anything.

It seems to work on everything else, IE, FireFox, Chrome, iPad, iPhone and Android phone

thanks


Petyo
Telerik team
 answered on 08 Sep 2014
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
Application
Drag and Drop
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
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
Licensing
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
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?