Telerik Forums
Kendo UI for jQuery Forum
3 answers
976 views

Hi there

I came across a problem, where I couldn't find a solution yet: I've created a MVVM based form with a kendo combobox (<select data-role="combobox" name="my-element">), a custom invalid message element for this <select> (<span class="k-invalid-msg" data-for="my-element">) and a custom validator. When validating both fields, the <select> and the <input> element of the widget, are given to the validator and are validated correctly. I now face the problem, that I'm not able to show the error message AND append the invalid class to the widget input automatically. There are two possible cases:

1) The widget <input> is validated. This way the input gets a k-invalid class and I can style the element to give an optical error. But at the same time the message <span> is ignored, since the name of the widget <input> and data-for do not match because kendo had to add an _input extend to the class.

2) The <select> is validated. This way, the message is shown correctly, but the k-invalid class is given to the hidden <select> element, while the <input> of the widget remains untouched.

What I would expect is that I can validate the widget <input> while the k-invalid class is appended to the widget itself and the k-invalid-msg <span> I defined for the original <select> element would be used to show the widgets error message. Why is this not the case?

Alexander Valchev
Telerik team
 answered on 29 Jul 2015
3 answers
186 views

Hi, I am using a kendo UI grid and have multiple filters for status -  closed, cancelled, finished. In order for me to remove one of the filters and not see the extra 'and' logic in html above the grid, I have to make the method call for removal twice or click the 'x' to remove the filter twice. I am not sure what is causing this behavior and any help will be appreciated. 

 

Here is the method call:

       var newfilter = removeFilter(existingFilters, $(param).attr('data-field'), $(param).attr('data-operator'), $(param).attr('data-value'));

 

Here is the  removeFilter method:

function removeFilter(filter, field, operator, value) {

  if (filter == null)
      return [];

  for (var i = 0; i < filter.length; i++) {
    if (filter[i].filters != null && filter[i].filters.length >= 0) {
      if (filter[i].filters.length == 0) {
          filter.splice(i, 1);
        return removeFilter(filter, field, operator, value);
      }

      filter[i].filters = removeFilter(filter[i].filters, field, operator, value);
    }
    else {
      if (filter[i].field == field && filter[i].operator == operator && filter[i].value.toString() == value) {
        filter.splice(i, 1);
        return removeFilter(filter, field, operator, value);
      }
    }
  }

  return filter;
}

 Here is the html method to display the filter:

function gridFilter(gridSelector, filter) {
  if (!filter) return '';

  var html = '';

  if (filter.filters) {
      for (var i = 0; i < filter.filters.length; i++) {
          if (filter.logic && i > 0)
          {
                      html += '<span class="op">' + filter.logic + '</span>';
          }

        if ($.isArray(filter.filters[i].filters))
            html += gridFilter(gridSelector, filter.filters[i]);
       else
        html += '<span class="param" data-field="' + filter.filters[i].field + '" data-operator="' + filter.filters[i].operator + '" data-value="' + filter.filters[i].value + '">' + formatField(gridSelector, filter.filters[i].field) + ' ' + formatOperator(filter.filters[i].operator) + ' ' + formatValue(filter.filters[i].value) + '<span class="remove">&times;</span></span>';
    }
  }

  return html;
}

 

Thanks!

Kann

Alexander Valchev
Telerik team
 answered on 29 Jul 2015
3 answers
316 views

Hello,

1. I am trying implement functionality of updating cell value on checkbox click. For example, if checkbox in checked, the tax should be added to the total.

2. Also, Total field should read only and in currency format.
For some reason, when Total type is number - “edit” function is not working, if Total type is string - “edit” function is ok, but currency format is lost.

Thank you for your help.

http://jsfiddle.net/gdouauyw/7/​

Alexander Popov
Telerik team
 answered on 29 Jul 2015
1 answer
163 views
Is it possible to add square meters to numeric text box. Not € or $, but m<sup>2</sup>?
Plamen Lazarov
Telerik team
 answered on 29 Jul 2015
4 answers
350 views

Hi,

 

I noticed recently that if I use day/week view (which will have a long scheduler container) and I click on the event after scrolling down a bit, it will automatically scroll itself up (focus) to the top position of the event item itself, in which case caused by Browser's behavior. Because of this, I can't have access for example if I want to resize the event (with 1hour slot) up to 10hours slot.

 I realized if I remove the selectable configuration, it would do fine without the focusing and scroll up problems (so the problem I described earlier won't be a problem). Then I also found out that this selectable configuration problem will cause the problem at hand only in Internet Explorer and not in Google Chrome so it won't be a problem if I use Google Chrome as a solution.

 

However, if the div element, in which the kendo scheduler is assigned, has its css height property set, it will cause the problem to arise in both IE and Chrome. In my case, setting the selectable to "true" and set the div's height are really necessary. At the very least I can use Google Chrome to avoid the problem caused by selectable configuration. Unfortunately I still have the problem due to the height property.

 

So, is this bug gonna be solved soon or is there a work around for this? (at least for the "height" cause)

 

THank you

Vladimir Iliev
Telerik team
 answered on 29 Jul 2015
2 answers
115 views

Hi,

if I use a template to customize a kendo grid data entry, I can pass a key as a parameter to a js function. In this way I can customize the behaviour of the function depending on other keys in the model field (=table row).

Just a nonsense example to show what I mean:

Let's say we have the data

[{ id: 1, name: "foo" }]

and the model

{ id: "id", fields: {"foo": {type: "String"},"id": {type: "Number"}}

then I can write into the "foo" column template key

kendoGrid({ columns: [{field: "foo", template: "#=getID(id)#"}] })

which references to the js function

function getID(id) { return "<b>"+id+"</b>" }

 

I'm a bit suprised that this works (has somebody an explanation why the template can access the id key of the data)? I'm quite new to js...), but it does and is quite helpful for me.

Now to the topic: I'd like to to customize the editor - a dropdownlist like in the example http://demos.telerik.com/kendo-ui/grid/editing-custom. But the content of this dropdownlist should change according to the data. Is there a way to pass the value of a key to the editor function in a similar way like in the template example above?

function dropDownListEditor(container,options,id) {

[...]

kendoDropDownList({dataSource: {data: dropdowncontent[id]}}))

[...] 
}

 As I have understood the editor function has the predefined parameters container+options, are these fixed or somehow extendable? Which is the best way to implement such a behaviour?

 

Thanks in advance!

Sebastian
Top achievements
Rank 1
 answered on 29 Jul 2015
9 answers
425 views

Hi, 

When I use e.preventDefault();  for editing by a condition based on event data, It returns wrong event data. Please check sample application and follow below steps to reproduce the error. 

1. Use google chrome and press Ctrl + Shift + I to get the console 

2. Click in Add Event button in the application and it will show events for the period. 

3. If you double click on an event and check event data such as start, end date, It always gives wrong data when you use e.preventDefault();

 Any idea how to solve this issue?

 

Thanks, 

Lilan

 

 

Vladimir Iliev
Telerik team
 answered on 29 Jul 2015
1 answer
501 views

Initializing from HTML table, how can I specify a column to be hidden? I need to access the data for that column in JS, but don't want to have that data visible to the end user.

http://demos.telerik.com/kendo-ui/grid/from-table

I've tried to use the attribute: data-hidden="true" on the th tag (data-field is also on th tag, as it is in the demo), but it's not working.

Thanks,

--Ed

Venelin
Telerik team
 answered on 29 Jul 2015
3 answers
1.3K+ views

Hello, 

 I want to refresh and reload kendo UI scheduler with new data after it was initialized.  Please find configuration as below. 

 <div id="schedulerTimeLine" kendo-scheduler k-options="schedulerTimeLineOptions"></div>

$scope.schedulerTimeLineOptions was set when the page is loaded and then I want to change the configurations of $scope.schedulerTimeLineOptions later and I will update the scope. So even after I updated $scope.schedulerTimeLineOptions scheduler doesn't load new data.

So I want to refresh and reload the kendo UI scheduler which I could not find a solution. 

 

Please Help

Thanks, 

Lilan

Vladimir Iliev
Telerik team
 answered on 29 Jul 2015
3 answers
62 views

Do you have the popular "label as" feature (where we can assign different labels to choose from...like personal, business, etc.), OR the "show time as" feature (where we can assign different statuses/colors to choose from...like busy, vacation, out-of-office, etc.) ?

 The DevExpress scheduler has both of these...do you?

Vladimir Iliev
Telerik team
 answered on 29 Jul 2015
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?