Telerik Forums
Kendo UI for jQuery Forum
5 answers
101 views
Hello,

I'm using Kendo ver. 2014.1.416 and I've created a grid that contains a chart inside its last column.
When I resize the browser, charts do not properly gets resized on Internet Explorer 9. Specially this problem occurs for charts which are existed on even rows.
This problem just occurs on IE9.

I've reproduced the code and it's on: http://jsfiddle.net/saes/AZbKh/3/

Could you please help me what's wrong with my code?

Regards,
Sam
T. Tsonev
Telerik team
 answered on 27 May 2014
1 answer
94 views
Hi,
I am using using kendos Chart control to display four series in graph that shares a common categoryAxis.
I am send data to chart by a Model that contains four properties. These Properties returns me four collection. I want to bind these Properties to my Series of Kendo Chart.
Please suggest if I can achieve this using Model as mentioned above.
Kinf Regards,
Dinesh Mishra
T. Tsonev
Telerik team
 answered on 27 May 2014
2 answers
527 views
First, love the control, love the MVC wrapper, love the extensibility, love the support and available help.  Now to the issue!

I have created a custom edit template which includes resources.  However, I want some of those resources to not be displayed if the difference between the event start and the time the user double clicks the event is, say, greater than 24 hours. 

I used the Scheduler edit event to set a variable in a javascript function like so...

        .Events(e => { e.Edit("checkValidCancelDate"); }

The function (and global variable):

var showCancelOptions = true;
function checkValidCancelDate(e) {
    var start = e.event.start;
    var now = new Date();

    var startMs = start.getTime();
    var nowMs = now.getTime();

    var hours = (startMs - nowMs) / (1000 * 60 * 60);

    if (hours <= 24) {
        showCancelOptions = false;
    }
}

That all works, but here is the kicker...if I check for that variable with my sweet custom script for the editor template, the variable's value isn't set appropriately, and the resources display.  The script (inside the editor template script) looks like..

 if (resources[resource].title != 'I plan on:' || showCancelOptions) {
       ... 8< ... classic Kendo resource display template code goes here
 }

Because that script actually runs BEFORE the edit event is handled!!!  I have verified this with alert statements.  So the second time the user edits the event, it actually works (the resources don't display), because the editor template script takes the value of the variable from the previous edit click!!!

So, my question is, is there a way to make the edit event fire BEFORE the custom editor template script runs to generate the HTML for the modal dialog that pops up?  Or similarly, is there a way to make the event edit dialog be constructed and shown AFTER the edit event has fired?

Thanks in advance!
Adam
Vladimir Iliev
Telerik team
 answered on 27 May 2014
1 answer
292 views
I have implemented a template to modify how the day and week view headers are shown using DateHeaderTemplate, but I can't seem to find any way to modify how the Month view headers are displayed?  I simply want to center the text.  Is there a way to do this?
Vladimir Iliev
Telerik team
 answered on 27 May 2014
1 answer
213 views
Hi,
I have a datepicker where I was setting the depth of the calander following the exaple as in
http://jsfiddle.net/krustev/nPDmK/.
This was working for me till I upgraded to the Kendo release 2014.1.416.

Now I get the exception "dateView.calendar is not defined" against the code
var datepicker = $("#StartDate").data("kendoDatePicker");
var dateView = datepicker.dateView;
dateView.calendar.element.removeData("dateView");


Is there something I have to change to adapt to the new Kendo library ?

Kind Regards

Achilles
Georgi Krustev
Telerik team
 answered on 27 May 2014
1 answer
243 views
Hi,

I’m using telerik.kendoui.professional.2014.1.416.commercial, it seems cascading comboboxes with pre-set the selected items don’t work correct with local data sources or I don’t configure them correct.
I modified the script section of the http://demos.telerik.com/kendo-ui/web/combobox/cascadingcombobox.html example to the following code: 

$(document).ready(function() {
     var categories = $("#categories").kendoComboBox({
         filter: "contains",
         placeholder: "Select category...",
         dataTextField: "CategoryName",
         dataValueField: "CategoryID",
         dataSource: { data: [{"CategoryName": "Condiments", "CategoryID": 2}] },
         value: 2
     }).data("kendoComboBox");
 
     var products = $("#products").kendoComboBox({
         autoBind: false,
         cascadeFrom: "categories",
         filter: "contains",
         placeholder: "Select product...",
         dataTextField: "ProductName",
         dataValueField: "ProductID",
         dataSource: { data: [{"ProductName": "Chef Anton's Gumbo Mix", "ProductID": 5, "CategoryID": 2}, {"ProductName": "Aniseed Syrup", "ProductID": 3, "CategoryID": 2}] },
         value: 5
     }).data("kendoComboBox");
 
     var orders = $("#orders").kendoComboBox({
         autoBind: false,
         cascadeFrom: "products",
         filter: "contains",
         placeholder: "Select order...",
         dataTextField: "ShipCity",
         dataValueField: "OrderID",
         dataSource: { data: [{"ShipCity": "Graz", "OrderID": 10382, "ProductID": 5}, {"ShipCity": "London", "OrderID": 10289, "ProductID": 5}] },
         value: 10382
     }).data("kendoComboBox");
 
     $("#get").click(function() {
         var categoryInfo = "\nCategory: { id: " + categories.value() + ", name: " + categories.text() + " }",
             productInfo = "\nProduct: { id: " + products.value() + ", name: " + products.text() + " }",
             orderInfo = "\nOrder: { id: " + orders.value() + ", name: " + orders.text() + " }";
 
         alert("Order details:\n" + categoryInfo + productInfo + orderInfo);
     });
 });

In result the first cascading combobox # products loads its filtered options and preset its selected item, but the second cascading combobox #orders stays disabled same as its parent (#products) does not have a value.

Here is what I found in the kendoui.web code, the brief execution flow is:

1.  #categories combobox init executes, initially it sets selectedIndex to -1, but due to options.autoBind is true it runs _filterSource method, it leads to firing of the datasource change event, that causes the combobox refresh and due to it has value, the matched item being selected (selectedIndex is not -1).

2.  #products combobox init executes. It runs _cascade method, it updates the autoBind property to false, the parent (#categories) datasoure is set and it has a selected item (i.e. parent's data item is defined), so it leads to selection of matching #products item (selectedIndex is not equal to -1). Immediately after _cascade execution _init method overrides selectedIndex back to -1 (but does not clear selection) and due to the autoBind option has been set to false, the _init doesn’t call  _filterSource method, i.e. in result the #products has selected item, but its selectedIndex property is not synchronized.  

3.  #orders combobox init executes. It runs _cascade method, but its parent data item cannot be get, due to parent’s selectedIndex is equal to -1. That leads #order combobox to stay disabled.

I found a solution modifying the read methos of combobox datasource transport objects using some timeout:

 

$(document).ready(function() {
    var categories = $("#categories").kendoComboBox({
        filter: "contains",
        placeholder: "Select category...",
        dataTextField: "CategoryName",
        dataValueField: "CategoryID",
        dataSource: {
            type: "json",
            serverFiltering: true,
            transport: {
              read: function(options) {
                var _data = [{"CategoryName": "Condiments", "CategoryID": 2}];
                setTimeout(function() { options.success(_data); }, 100);
              }
            }                         
        },
      value: 2
    }).data("kendoComboBox");
 
    var products = $("#products").kendoComboBox({
        autoBind: false,
        cascadeFrom: "categories",
        filter: "contains",
        placeholder: "Select product...",
        dataTextField: "ProductName",
        dataValueField: "ProductID",
        dataSource: {
            type: "json",
            serverFiltering: true,
            transport: {
              read: function(options) {
                var _data = [{"ProductName": "Chef Anton's Gumbo Mix", "ProductID": 5, "CategoryID": 2}, {"ProductName": "Aniseed Syrup", "ProductID": 3, "CategoryID": 2}];
                setTimeout(function() { options.success(_data); }, 100);
              }
            }
           
        },
      value: 5
    }).data("kendoComboBox");
 
    var orders = $("#orders").kendoComboBox({
        autoBind: false,
        cascadeFrom: "products",
        filter: "contains",
        placeholder: "Select order...",
        dataTextField: "ShipCity",
        dataValueField: "OrderID",
        dataSource: {
            type: "json",
            serverFiltering: true,
            transport: {
              read: function(options) {
                var _data = [{"ShipCity": "Graz", "OrderID": 10382, "ProductID": 5}, {"ShipCity": "London", "OrderID": 10289, "ProductID": 5}];
                setTimeout(function() { options.success(_data); }, 100);
              }
            }
        },
      value: 10382
    }).data("kendoComboBox");
 
    $("#get").click(function() {
        var categoryInfo = "\nCategory: { id: " + categories.value() + ", name: " + categories.text() + " }",
            productInfo = "\nProduct: { id: " + products.value() + ", name: " + products.text() + " }",
            orderInfo = "\nOrder: { id: " + orders.value() + ", name: " + orders.text() + " }";
 
        alert("Order details:\n" + categoryInfo + productInfo + orderInfo);
    });
});

Could you recommend me another approach to solve that problem or advice me how properly to configure the cascading comboboxes to work with local data?

Thanks
 

Georgi Krustev
Telerik team
 answered on 27 May 2014
4 answers
301 views
I am currently investigating the Kendo UI.

Is it really true that you cannot edit a grid without a trip to the server for each add/update/delete with a popup editor?  I would like the grid to be part of a larger object and nothing gets saved until the entire object gets saved.  This seems like a very common scenario to me!  Am I missing something?

If I don't supply a Create action, I get a compile error.  If I set batch mode to true, and I leave off the Save command in the grid, it calls the create command when I add a row through a popup editor (and it calls the batch version of create passing multiple objects which is strange since the save should be deferred).  If I set batch mode to true and include the Save command, I get a runtime error:

"You must use InCell edit mode for batch updates"

How can I use a popup editor for the grid and post the entire form to save my changes at a later date while avoiding constant trips to the server?

Leslie

@(Html.Kendo().Grid(Model.item.vendoritems)
.Name("grdVendorItems")
.Columns(columns =>
{
columns.Bound(c => c.vendorid);
columns.Bound(c => c.vendoritemcode);
columns.Bound(c => c.name);
columns.Bound(c => c.description);
columns.Bound(c => c.uomclassid);
columns.ForeignKey(c => c.vendorid, Model.vendorList, "Value", "Text");
columns.Command(command => { command.Edit(); });
}
)
.ToolBar(toolbar => { toolbar.Create(); toolbar.Save(); })
.Editable(editable =>
{
editable.Mode(GridEditMode.PopUp);
editable.TemplateName("vendoritemEditor");
editable.AdditionalViewData(new { VendorList = Model.vendorList, UOMClassList = Model.uomClassList });
}
)
 .Sortable()
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.Batch(true)
.Model(model =>
{
model.Id(i => i.id);
model.Field(i => i.id).Editable(false);
})
.Events(events => events.Error("error_handler"))
.Create(update => update.Action("EditingPopup_Create", "VendorItems"))
.Update(update => update.Action("EditKendo", "VendorItems"))
)
)
Petur Subev
Telerik team
 answered on 27 May 2014
3 answers
832 views
Hello,

I have Master/Detail page layout where on the left side of the page there is Kendo Grid with the list of items and on the right side of the page there is specific item details.

I want to prompt confirmation message to the user if changes were done in the detail section and user clicked on the different item in the list of items grid prior to saving changes.

Initially, I though I should be able to catch "click" event and based on the prompt popup result either do nothing or apply 

e.stopPropagation();
e.preventDefault();
e.stopImmediatePropagation();

   function selectionValidation() {
       // Place your validation logic here
       return confirm("Change selection");
   }
 
onGridDataBound: function () {
           // Intercept click event to prevent row from loosing focus
           // if user decide not to loose changes done in the detail section
           this.grid.tbody.find("tr[class='templated-row ']").click(this.checkDataChanged);
     },
 
       checkDataChanged: function (e) {
           newValues = $('form').serialize();
 
           if (initialValues !== newValues) {
                   if (selectionValidation()) {
                   } else {
                       e.stopPropagation();
                       e.preventDefault();
                       e.stopImmediatePropagation();
               }
           }
       },


Apparently it is not working with click event in the Kendo Grid as selection within the grid changes prior to firing "click" event. I guess I just do not know where to hook my click event.

So then I decided to hook up to the mousedown event, which help me prevent row selection prior to closing prompt popup, but it looks like event chain breaks and no normal "click"-related processing happens. Row stays unselected and no change event fires.

Did I miss something? Can you suggest best way to achieve required functionality (prompt user prior to selecting row different from the one currently selected)?


Thank you,

Andrei
Andrei
Top achievements
Rank 1
 answered on 26 May 2014
3 answers
1.4K+ views
I currently have the multiselect working the way I want it with one exception.  Preloading previously selected items.


My view looks:

<div class="editor-field">       
    @Html.LabelFor(model => model.UntaggedPersons)
    @Html.ListBoxFor(model => model.PeopleToTag, 
             new SelectList(Model.CommitteeMembers, "PersonId", "FullName"))                
</div>

JS:

 $("#PeopleToTag").kendoMultiSelect({ "dataTextField": "FullName", "dataValueField": "PersonId", "placeholder": "Tag or Untag Persons to Action Item", "value": "taggedPersons" });


PeopleToTag is an IEnumerable<int> that posts to the controller
CommitteeMembers consists of a persons  First, Last, FullName, and PersonId

This works perfectly, I can manipulate who is tagged in post to the controller.

Now I want to add the functionality of preselecting those that are currently tagged.

How do I add a preselected Value?  I have a model with:  model.TaggedPersons consists of a persons First, Last, Fullname, PersonId.   How do I wire up the javascript to display the model.TaggedPersons as the already selected value?

I don't mind using the MVC wrapper approach if it is easier.

I've tried something like:

   <div class="editor-field">       
                @Html.LabelFor(model => model.TaggedPersons)
                @(Html.Kendo().MultiSelect()
                    .Name("PeopleToTag")
                    .Placeholder("These people are Tagged")
                    .BindTo(new SelectList(Model.CommitteeMembers, "PersonId", "FullName"))
                    .Value(Model.TaggedPersons)  
                   )
  </div>

However this isn't even rendering a kendo multiselect for me at present. I perhaps have a reference issue to work out there.  That's the general thought of how I want to approach it though.

Any help is much appreciated!

-Trevor







Daniel
Telerik team
 answered on 26 May 2014
1 answer
174 views
ModelState.IsValid is false with an error in the model that shows: 
     "The value 'Thu May 22 2014 08:00:00 GMT-0700 (US Mountain Standard Time)' is not valid for Start."
     "The value 'Thu May 22 2014 12:00:00 GMT-0700 (US Mountain Standard Time)' is not valid for End."

I am assuming this is due to my complete lack of understanding about the Scheduler and its use of Timezone.

Atanas Korchev
Telerik team
 answered on 26 May 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
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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?