Telerik Forums
Kendo UI for jQuery Forum
3 answers
1.0K+ views

I would like to pass additional parameters from the page to the scheduler read via javascript.  I have done this in the past with the kendo grid and this thread implies that the scheduler should work the same way https://www.telerik.com/forums/pass-additional-parameters-to-read-ajax-datasource-method---mvc but it isn't working for me.

 

I get the following error:

Compiler Error Message: CS1061: 'SchedulerAjaxDataSourceBuilder<CalendarItemGridItem>' does not contain a definition for 'Data' and no extension method 'Data' accepting a first argument of type 'SchedulerAjaxDataSourceBuilder<CalendarItemGridItem>' could be found (are you missing a using directive or an assembly reference?)

Source Error:
Line 42: m.RecurrenceId(f => f.RecurrenceId);

Line 43: })

Line 44: .Read("Schedule_Read", "Calendar").Data("getSchedulerData")

Line 45: .Create("Schedule_Create", "Calendar")

Line 46: .Destroy("Schedule_Destroy", "Calendar")

Neli
Telerik team
 answered on 01 Mar 2018
3 answers
440 views
Hi,

I'm currently trying to make the grid work with edit/create forms loaded from the server.
I have searched the documentation, and the forums but haven't been able to find the right way to do that.
I want to build and validate my forms server-side (using Symfony).
For now I only tried with the "editable" option set to "popup".

Here's what I'm trying to achieve :
  1. When clicking on the edit button, make an AJAX request on a URL I have added to the grid configuration. The request will contain the ID (the value of the field name specified in dataSource.schema.id) of the row I'm editing. It would also be nice to be able to add some kind of loader class on the button and disable it while we wait for the response.
  2. On the server, generate a form (pre-populated after fetching the object using its ID) and return the HTML in a JSON object.
  3. In the "ajax.success" function, open the popup and fill it with the HTML we just got back from the server.
  4. Change some values, submit the form to the server and validate the data on the server then do the same things we did at step 2 except this time the JSON object will also contain extra success/error messages.


Would there also be a way to do the same thing with the "editable" option set to "inline"?

Best regards.

Preslav
Telerik team
 answered on 01 Mar 2018
3 answers
223 views

Hello! I've noticed that with last kendo release (2018.1.221.545) if I set the dialog height in % (not in pixels) the dialog window is displayed bad, here the dojo:

https://dojo.telerik.com/AFidU/2

I don't know if this behaviour is wanted, but all my dialogs in my application uses % for height, so cause me quite big issues.

Greetings and good work!

Neli
Telerik team
 answered on 28 Feb 2018
5 answers
244 views

Hello,

does anybody know how to create a tooltip on hover for a Kendo treemap? Something like this but for ASP.NET MVC:

http://docs.telerik.com/kendo-ui/controls/charts/treemap/how-to/show-treemap-tooltip

 

I already tried this, but when i move the mouse over the fields nothing appears..

$("#treemap").kendoTooltip({
   filter: ".k-leaf,.k-treemap-title",
   position: "top",
   content: function (e) {
     var treemap = $("#treemap").data("kendoTreeMap");
     var item = treemap.dataItem(e.target.closest(".k-treemap-tile"));
     return item.name + ": " + item.value;
   }
 });

 

When i use the jquery function i can write the right values of each Treemap fiel in the javascript console.

$("#treeMap").on("mouseenter", ".k-leaf", function () {
   var item = $("#treeMap").data("kendoTreeMap").dataItem($(this).closest(".k-treemap-tile"));
   var text = "Name: " + item.Name + "  Value: " + item.Value;
console.log(text);

 

 

Thanks,

Stefan

Alex Hajigeorgieva
Telerik team
 answered on 28 Feb 2018
1 answer
3.3K+ views

Hi There,

I'm trying to get the ProductName from 'edit' from on click event and I want to take that pass it as a parameter to my controller, however, 

it looks like the drop-down editor function is being executed first before the 'edit' click event. So if you try and run the code below, it will not pick up any value when edit command is clicked. Basically, I want to do a query using the ProductName before populating my drop-down list.

 

<!DOCTYPE html>

<html>
<head>
    <meta charset="utf-8"/>
    <title>Kendo UI Snippet</title>

    <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.1.221/styles/kendo.common.min.css"/>
    <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.1.221/styles/kendo.rtl.min.css"/>
    <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.1.221/styles/kendo.silver.min.css"/>
    <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.1.221/styles/kendo.mobile.all.min.css"/>

    <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
    <script src="https://kendo.cdn.telerik.com/2018.1.221/js/kendo.all.min.js"></script>
</head>
<body>
  
<script src="https://demos.telerik.com/kendo-ui/content/shared/js/products.js"></script>
<div id="example">
    <div id="grid"></div>

    <script>
var cat = '';
        $(document).ready(function () {
            var dataSource = new kendo.data.DataSource({
               pageSize: 20,
               data: products,
               schema: {
                   model: {
                     id: "ProductID",
                     fields: {
                        ProductID: { editable: false, nullable: true },
                        ProductName: { validation: { required: true } },
                        Category: { defaultValue: { CategoryID: 1, CategoryName: "Beverages"} },
                        UnitPrice: { type: "number", validation: { required: true, min: 1} }
                     }
                   }
               }
            });

            $("#grid").kendoGrid({
                dataSource: dataSource,
                pageable: true,
                height: 550,
                toolbar: ["create"],
                columns: [
                    { field:"ProductName",title:"Product Name" },
                    { field: "Category", title: "Category", width: "180px", editor: categoryDropDownEditor, template: "#=Category.CategoryName#" },
                    { field: "UnitPrice", title:"Unit Price", format: "{0:c}", width: "130px" },
                    { command: "edit", title: " ", width: "150px" }],
                editable: "inline",
                edit: function(e) {
                  var model = e.model; //reference to the model that is about the be edited
                  cat = model.ProductName;
                  alert(cat);
cat = model.ProductName;
                  var container = e.container; //reference to the editor container

                  var categoryDropDownList = container.find("[data-role=dropdownlist]").data("kendoDropDownList"); //find widget element and then get the widget instance
                  // if DropDownListwidget is found
                  if (categoryDropDownList) {
                    //use DropDownList API based on the model values to accomplish your bussiness requirement.
                    //link: http://docs.telerik.com/kendo-ui/api/javascript/ui/dropdownlist
                    console.log("DropDownList", categoryDropDownList);
                  }

                  var priceNumericTextBox = container.find("[data-role=numerictextbox]").data("kendoNumericTextBox"); //find widget element and then the widget instance
                  if (priceNumericTextBox) {
                    //use NumericTextBox API
                    //link: http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox
                    console.log("NumericTextBox", priceNumericTextBox);
                  }
                }
            });
        });

      
        function categoryDropDownEditor(container, options) {
          alert(cat);
            $('<input required data-text-field="CategoryName" data-value-field="CategoryID" data-bind="value:' + options.field + '"/>')
                .appendTo(container)
                .kendoDropDownList({
                    autoBind: false,
                    dataSource: {
                        type: "odata",
                        transport: {
                            read: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Categories"

                           //url: "@Html.Raw(Url.Action("MyAction", "MyController", new {Id = Model, Cat = Cat }))",

                        }
                    }
                });
        }

    </script>
</div>
</body>
</html>

Jake
Top achievements
Rank 1
 answered on 28 Feb 2018
1 answer
434 views

Hi,

I am having a requirement to add multiple filters in a column of grid i.e. By default we can add 2 filters but what I want is to increase it to 6 or more.

And also I want to know is there any limit for it i.e. we can add only n number of filters in a columns of grid.  

If so, then what is the max limit for adding multiple filters for a single column using Kendo UI and also how to achieve this.

Requirement :- 

What I actually want is a option to add multiple filters for a specific columns. When ever user clicks on the filter funnel he will be given with one or 2 filter criteria that he can choose and with a button or option to add more filters to the same column if he wants.

Please refer the below attached Image for more clarification.And let me know how I can achieve it using Kendo UI.

If this is not possible then any option that fulfils this requirement to add multiple filters will work for us.

 

 

Tsvetina
Telerik team
 answered on 27 Feb 2018
7 answers
4.4K+ views
I am having an issue with the template system

my datasource is volatile by design to allow for maximum flexibility. Everything works great except I have one problem. If an item is undefined it ceases to render any other items if a template is applied. I will use a grid object to explain.

$("#grid").kendoGrid({
                dataSource: dataSource,
                groupable: true,
                sortable: true,
                pageable: {                   
                    pageSizes: true
                },
                columns: [{
                    field: "FirstName",                   
                    title: "First Name"                   
                }
                ,
                {
                    field: "LastName",                   
                    title: "Last Name"
                }
                ,
                {
                    field: "City"
                }
                ,
                {
                    field: "Title"
                }
                ,
                {
                    field: "BirthDate",
                    title: "Birth Date",
                    template: '#: FormatDate(BirthDate,"dd MMMM yyyy") #'
                }
                ,
                {
                    field: "Age"
                }
                ]
            });

Incoming Data
[
{"FirstName":"John","LastName":"Smith","City":"Smalltown","Title":"AR","BirthDate":"1984-07-16T05:00:00Z","Age":28},
{"FirstName":"John","LastName":"Smith","City":"Smalltown","Title":"AR","BirthDate":"1984-07-16T05:00:00Z"},
{"FirstName":"John","LastName":"Smith","City":"Smalltown","Title":"AR"}
]

If the template is not set it works as expected non existing members are not shown and everything is hunky dory. But with the template an error gets thrown when it can find BirthDate and stops rendering the grid.
ReferenceError: BirthDate is not defined
 
kendo.all.js Line 281 : return new Function(argumentName, functionBody);


I've tried doing an if statement in the template to return null if the object is undefined but that didn't seem to make a difference.

Any thoughts on possible workarounds?
Graham
Top achievements
Rank 1
 answered on 27 Feb 2018
1 answer
554 views

I have a dynamically generated table that gets converted into a Kendo Grid. Whenever I try to export to a PDF the export works great but the grid rows disappear when it's done.  Interestingly, if i remove the paperSize, the lines stay there but the template is lost.  Here is my code:

 

 
<%
     var names = new List<string> {"Bubba", "Jane"};
 %>
    <table id="grid">
        <thead>
        <colgroup>
            <col style="width:320px"/>
            <col />
        </colgroup>
        <tr>
            <th data-title="Name"></th>
            <th data-title="Name 2"></th>
        </tr>
        </thead>
        <tbody>
        <%
 
            foreach (var item in names)
            {%>
            <tr>
                <td><%= item %></td>
                <td><%= item %></td>
            </tr>
        <%}
        %>
 
        </tbody>   
    </table>   
 
     
 
    <script type="x/kendo-template" id="page-template">
      <div class="page-template">
        <div class="header">
          Details
        </div>
        <div class="footer">
          Page #: pageNum # of #: totalPages #
        </div>
      </div>
    </script>  
     
 
    <script>
  
        $(document).ready(function () {
            $("#grid").kendoGrid({
                toolbar: ["pdf"],
                pdf: {
                    allPages: true,
                    avoidLinks: true,
                    paperSize: "A4",
                    margin: { top: "2cm", left: "1cm", right: "1cm", bottom: "1cm" },
                    landscape: true,
                    repeatHeaders: true,
                    template: $("#page-template").html(),
                    scale: 0.5
                },
                height: "auto",
                sortable: true
            });
 
 
        });
    </script>
Boyan Dimitrov
Telerik team
 answered on 27 Feb 2018
1 answer
266 views
     Does anyone know how to make the scrollable menu option work based on the size of the screen?  I can get it to work if I explicitly set a width on my menu but I want the menu width to be based on the screen size.  So if a user is viewing the menu full screen it wouldn't scroll because everything fits but if they shrink the window (or view it on a smaller screen) then it would scroll.
Neli
Telerik team
 answered on 27 Feb 2018
1 answer
210 views

How to do RadImageGallery in MVC ?

is it possible to do RadImageGallery in MVC ?

Pavlina
Telerik team
 answered on 27 Feb 2018
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
ScrollView
Switch
TextArea
BulletChart
Licensing
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
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?