Telerik Forums
Kendo UI for jQuery Forum
2 answers
205 views
Hi,

how do I send the current multiselect values to an asp.net mvc 4 action, as a IEnumerable<int>?

I have:
@(Html.Kendo().MultiSelect()
         .Name("Fields")
         .DataTextField("Name")
         .DataValueField("Id")
         .Value(ViewData["tagslist"] as IEnumerable<int>)
         .Filter(FilterType.Contains)
         .Placeholder("...")
         .Events(e =>
           {
               e.Change("change_field");
           })
          .DataSource(source => {
              source.Read(read =>
              {
                  read.Action("ShowFields", "Folders");               
              });
 
         })
And I want to send the selected id's to an action which updates a model bound treeview:
<div id="tree">
    @(
 Html.Kendo().TreeView()
            .Name("treeview")
            .ExpandAll(true)
            .TemplateId("treeview-template")
            .DragAndDrop(true)
            .BindTo(Model)
             .Events(events => events
                    .DragEnd("onDragEnd")
                )
            )
</div>
This is my action to create the new model for the treeview:
public ActionResult Index(IEnumerable<int> fieldTags,int id = 1 )
{
    IEnumerable<TreeViewItemModel> kendoModel = new List<TreeViewItemModel>();
    SopFolder kendoStartFolder = db.SopFolders.Where(r => r.Id == id).Take(1).Select(r => r).ToList()[0];           
     
    kendoModel = CreateKendoTree(kendoStartFolder, fieldTags);
 
    var SopFields =
     db.SopFields
    .Select(r => new
    {
        Value = r.Id,
        Text = r.Name
    });
    List<int> tagslist = new List<int>();
    foreach(var tag in SopFields)
    {
        tagslist.Add(tag.Value);
    }
    ViewData["tagslist"] = tagslist;
 
    if (Request.IsAjaxRequest())
    {
        return PartialView("_Tree", kendoModel);
    }
 
    return View(kendoModel);
}

So I need to do the following things:

1. Get the MultiSelect currently selected id's data passed to the server as an IEnumerable<int> into the index action with ajax request
2. Replace the content within the tree div with the new loaded treeview (if ajaxrequest, the action returns a partial view).

I am having trouble with number 1. Please give me some advice on how to solve this.

Thanks!

Best regards,
Marcus
Danilo
Top achievements
Rank 1
 answered on 04 Nov 2013
1 answer
171 views
In my implementation, I have a Kendo ListView contains another inner ListView. Each item in the inner ListView is an editable Kendo Grid. So, it is ListView->ListView->Grid relationship. The data binding works and view looks good initially.

But our requirement is to allow user to add new Grid (new item) inside the inner ListView by clicking a button, so I assigned an editable template to the inner ListView (by doing .Editable(editable => editable.TemplateName("SomeEditorTemplate"))). But it didn't work, it throws "invalid template" exception. I found that if the item inside the inner ListView is a TextBox instead of a Grid, then it works.

So, my questions is:
Does Kendo ListView support this kind of scenario (ListView contains ListView contains Grid)? If so, how can I add a new Grid item inside the inner ListView? I will appreciate if you can post a sample project or sample code.

Thanks!

Jie
Petur Subev
Telerik team
 answered on 04 Nov 2013
2 answers
242 views
the fiddle:
http://jsfiddle.net/TdEZE/12/

This fiddle works in Chrome and FF, but not IE 11 (Win8.1).
Curiously, in my application the color picker does work when only using ' palette : "basic" ', but that does not work in this fiddle.

edit:
Just found out that kendoMenu is also broken in IE 11. 
http://jsfiddle.net/Dkrhp/3/
Robert
Top achievements
Rank 1
 answered on 04 Nov 2013
2 answers
2.3K+ views
Hello,

First of all, sorry for asking the question which has been asked many times before! I looked around, and I seem to be doing everything right, but still getting no result.
Here's the problem: I have a Grid with DataSource with autoBind set to false. Upon a certain action, I'd like to pass additional parameters to DataSource, and to read the data. However, after setting the parameters, when "read" happens I can see in the "Network" tab in Dev Tools, that my additional parameters are not sent. I have tried to do it two different ways:

1. Set transport read data:
    $('#lookupDataGrid').data('kendoGrid').dataSource.transport.read.data ={"UserLookupTableID":123};
console.log($('#lookupDataGrid').data('kendoGrid').dataSource.transport.read.data); // outputs correct object
    $('#lookupDataGrid').data('kendoGrid').dataSource.read();
The network tab shows this (my additional parameter is not there): 
.../lookup-tables/get-lookup-data?take=15&skip=0&page=1&pageSize=15

2. Change the read URL to include my parameter:
var url = '.../lookup-tables/get-lookup-data?UserLookupTableID=123;
$('#lookupDataGrid').data('kendoGrid').dataSource.transport.read.url = url;
$('#lookupDataGrid').data('kendoGrid').dataSource.read();
The network tab shows the same output as above!! It is as if the chances I'm making are ignored...

I'm stumped. Am I don't something wrong? Please let me know...
Kate | D-Flo
Top achievements
Rank 1
 answered on 04 Nov 2013
9 answers
265 views
I created a VS2012 project using the C# Kendo MVC web wizard (2013 MVC Q2) and ran the project without making any other changes.  The app runs but I see the following exceptions in the Output window when I run the page in IE10  (v10.0.9200.16686):
  • Exception was thrown at line 4, column 9009 in http://localhost:6616/Scripts/kendo/2013.2.918/jquery.min.js
  • 0x800a139e - JavaScript runtime error: SyntaxError
  • Exception was thrown at line 4, column 9238 in http://localhost:6616/Scripts/kendo/2013.2.918/jquery.min.js
  • 0x800a139e - JavaScript runtime error: SyntaxError

The app appears to run but the exceptions are a bit disconcerting.   Run the same project in Chrome or Firefox and there are no errors in the output window.  Is this a problem with Kendo or with IE10?
Dimo
Telerik team
 answered on 04 Nov 2013
1 answer
98 views
When I open themebuilder on top of my site all of the charts go blank to just seeing a generic axis.  This happens as soon as I run the applet.  Any suggestions on how to get this working?

Attached is a screenshot of what it looks like when i open themebuilder. Prior to opening it there are a series of mostly bar charts and pie charts.

Thanks
J
Iliana Dyankova
Telerik team
 answered on 04 Nov 2013
1 answer
258 views
I have used this before, and it worked, but for some reason it is ceasing to out of nowhere. I have a situation where I am using nested templates like this ...

using the following model, this doesn't display the second level results, for some reason. But SOMETIMES it does. I cannot reproduce the behavior consistently.

{
  "Id": null,
  "Name": "Test Item",
  "Prototypes": [
    {
      "Id": "items/prototypes/shield",
      "Name": "Shield",
      "Mutations": [
        {
          "Name": "Shield",
          "Measurement": 4,
          "Statistic": {
            "Id": "statistics/damage-reduction-physical",
            "Name": "Damage Reduction/Physical"
          }
        },
        {
          "Name": "Shield",
          "Measurement": 15,
          "Statistic": {
            "Id": "statistics/health",
            "Name": "Health"
          }
        }
      ],
      "Consumable": false,
      "Equipable": true,
      "Tags": [
        {
          "Id": "tags/shielding",
          "Name": "Shielding",
          "Description": "This  is capable of somehow shielding the user, either with mitigation or abilities"
        }
      ]
    }
  ]
}
<div
     data-role="listview"
     style="margin: 0px;"
     data-template="templates-admin-inherited-prototypes"
     data-bind="source: Prototypes"></div>
<script type="text/html" id="templates-admin-inherited-prototypes">
    <h2 data-bind="text: Name"></h2>
    <div
         data-template="templates-admin-inherited-mutation"
         data-bind="source: Mutations"></div>
  
</script>
<script type="text/html" id="templates-admin-inherited-mutation">
    ${ Statistic.Name }
</script>
Petyo
Telerik team
 answered on 04 Nov 2013
8 answers
244 views
Hello ,

We are trying to to make the tooltip of one of the series visible as false ( dont show it ) on the shared tooltip on Kendo Line chart.
Somehow with the given help/examples it is not working .

Secondly whenever we mouse hover on the Legend the shared tooltip shows upto and stick , which we definitely dont want ..

Can you please look into these two issues.

Thanks

Attached the sample.
Sebastian
Telerik team
 answered on 04 Nov 2013
4 answers
772 views
Tried this:

.k-scheduler-table td{
    height: 72px !important;
}.k-scheduler-table td{
    height: 72px !important;
}

The elements inspector shows my style is being applied, but the height of each day cell is still 105px.  How can I control the height?  These cells have no content so that's not an issue, just empty cells.
Vladimir Iliev
Telerik team
 answered on 04 Nov 2013
4 answers
760 views
Is it possible to set the column.values property after the grid has been initialized?

I tried this with no luck:

        var rankList = [
            { value: 1, text: "Rank 1" },
            { value: 2, text: "Rank 2" },
            { value: 3, text: "Rank 3" },
            { value: 4, text: "Rank 4" },
            { value: 5, text: "Rank 5" }
        ];
 
$kendoGrid.columns.filter(function (item) {
            return item.field === "Rank";
        }).forEach(function (item) {
            item.values = rankList;
        });
        //reset the grids columns
        $kendoGrid.setOptions({ columns: $kendoGrid.columns });
        $kendoGrid.refresh();

The grid was initially created using the MVC wrapper
   
.Columns(columns =>
{
    columns.Bound(p => p.UserAccountKey);
    columns.Bound(p => p.FirstName);
    columns.Bound(p => p.LastName);
    columns.Bound(p => p.EmailAddress);
    columns.Bound(p => p.Rank);
    columns.Command(command =>
    {
        command.Edit();
        command.Destroy();
    });
})
Kiril Nikolov
Telerik team
 answered on 04 Nov 2013
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
Map
Drag and Drop
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?