Telerik Forums
Kendo UI for jQuery Forum
6 answers
1.3K+ views

Ok so I have a kendo grid. Leaving off the definition to make not so long, but I do have autoBind: false on it. I then do the 3 functions below to add a custom multi-select filter to one column. The other thing I have is I set an initial filter on that same column in the grid definition. The problem I am having is that filter gets called twice, once with correct params and a 2nd time with the original filter, or if I have that original filter commented out; it will call it the second time using any other column filters on the grid you have set in the ui, but without using the custom filter on this one column.

I've spent all day and night trying to figure this out... Any ideas.

 

01.self.onSchemaPopulated = function (columns, model) {
02. 
03.        var measureKey = _.find(columns, function(item) {
04.            return item.field === 'measure_key';
05.        });
06. 
07.        measureKey.filterable =
08.            {
09.                extra: false,
10.                operators: {
11.                    string: {                          
12.                        eq: "Is equal to"                          
13.                    }
14.                },
15.                ui: self.measureKeyFilter                  
16.            };
17. 
18.    };
19. 
20.    self.measureKeyFilter = function (element) {
21. 
22.        element.removeAttr("data-bind");
23. 
24.        var menu = $(element).parent();
25. 
26.        menu.find(".k-filter-help-text").text("Show records for measure keys in:");
27.        menu.find("[data-role=dropdownlist]").remove();
28. 
29.        var multiSelect = element.kendoMultiSelect({
30.            dataBound: function (e) {
31.                e.sender.tagList.addClass('k-full-button');
32.                e.sender.ul.addClass('k-multiselect-items');
33.            },
34.            dataSource: _.invoke(self.itemSelected().measures(), 'measure_key'),
35.            tagMode: 'single',
36.            tagTemplate: '<div>#:values.length# measures selected...</div>',
37.            value: _.invoke(self.itemSelected().checkedMeasures(), 'measure_key'),
38.        }).data("kendoMultiSelect");
39. 
40.        menu.find("[type=submit]").on("click", { widget: multiSelect }, self.filterByMeasureKey);
41. 
42.    };
43. 
44.    self.filterByMeasureKey = function (e) {
45. 
46.        var newFilter = { logic: "and", filters: [] };
47.        var measureFilter = null;
48.        var values = e.data.widget.value();
49. 
50.        if (values.length !== self.itemSelected().measures().length) {
51. 
52.            measureFilter = { logic: "or", filters: [] };
53. 
54.            $.each(values, function (i, v) {
55.                measureFilter.filters.push({ field: "measure_key", operator: "eq", value: v });
56.            });
57. 
58.            newFilter.filters.push(measureFilter);
59. 
60.        };
61. 
62.        var grid;
63. 
64.        if (self.isRelationshipSummaryToggled()) {
65.            grid = $('#' + self.rsOptions.id).data("kendoGrid");
66.        } else {
67.            grid = $('#' + self.rdOptions.id).data("kendoGrid");
68.        };
69. 
70.        var currentFilters = grid.dataSource.filter();
71. 
72.        if (!isNull(currentFilters)) {             
73. 
74.            _.each(currentFilters.filters, function (x) {                  
75. 
76.                if (!_.isArray(x.filters)) {
77.                    newFilter.filters.push(x);
78.                } else if (x.filters[0].field !== 'measure_key') {
79.                    newFilter.filters.push(x);
80.                };
81. 
82.            });                
83. 
84.        };         
85. 
86.        grid.dataSource.filter(newFilter);
87. 
88.    };

Tony
Top achievements
Rank 1
 answered on 24 Aug 2016
3 answers
371 views

Inside a main grid I have a nested detail grid and a button. How is it possible to add a row to the nested grid on a button click. My solution doesn't work: @scope.detailsGrid is undefined (which is predictable).

$scope.addRow = function () {
                   var grid = $scope.detailsGrid.data("kendoGrid");
                   grid.addRow();
                   return false;
               };

<kendo-grid k-scope-field="mainGrid" options="mainGridOptions">
   <div k-detail-template>                                     
        <div kendo-grid k-scope-field="detailsGrid" k-options="detailGridOptions(dataItem)"></div>
         <button ng-click="addRow()" style="width:100px; height:30px;">Add row</button>                     
   </div>
</kendo-grid>
J
Top achievements
Rank 1
 answered on 23 Aug 2016
3 answers
2.2K+ views

How to draw a line between targeted Menu Items. Documentation says use 'k-separator' class. Is there alternative?

 

Also, By default a line is added after first menu item. How do i remove it? Please see attached.

Dimiter Madjarov
Telerik team
 answered on 23 Aug 2016
8 answers
612 views
"Stacked bar chart Tooltip -- Single Bar of multi Stacks should show all color with value on tooltip"
Peter
Top achievements
Rank 1
 answered on 23 Aug 2016
1 answer
139 views

Hi,

in a radio button list I want show datepickers.

Unfortunally on click the datepicker disappear immediately mostly - in some rarely cases not.

Example Dojo

If I move

<label style="float: left;margin-left:20px;width:50px">von</label><input id="dpstart" style="width:100px"/><br>
<label style="float: left;margin-left:20px;width:50px">bis</label><input id="dpend" style="width:100px"/>
behind </ul> it works.

But then the radio button "Select" is not selected by activate a datepicker.

 

Peter

Konstantin Dikov
Telerik team
 answered on 23 Aug 2016
1 answer
249 views
Hello Team,
I have issue in implementation (delete/Edit) of Kendo scheduler Occurrence 
After searching I found solution i.e. Recurrences Exception date in YYYY-MM-DDTHH: MM: 00.000Z Format but nothing happen.

Problem Explanation

Data Base:
Table with following fields (task ID, start, end, recurrence id, recurrence rule, recurrence exception)

task ID start end recurrence id recurrence rule recurrence exception
1 2016-08-23 08:00:00.000 2016-08-23 08:30:00.000 NULL FREQ=DAILY 2016-08-24 08:00:00.000
2 2016-08-24 08:00:00.000 2016-08-24 08:00:00.000 1 NULL NULL


When above data send to scheduler no exception come and one extra appointment created.
I am using client side scheduler. Is above mechanism correct?
How scheduler understand the task id =2 are deleted
Please suggest or provide link for both functionality i.e. (delete/Edit) of Kendo scheduler Occurrence 
Thanks 
Georgi Krustev
Telerik team
 answered on 23 Aug 2016
1 answer
599 views
Hello Team,
I have issue in implementation (delete/Edit) of Kendo scheduler Occurrence  
After searching I found solution i.e. Recurrences Exception date in YYYY-MM-DDTHH: MM: 00.000Z Format but nothing happen.

Problem Explanation

Data Base:
Table with following fields (task ID, start, end, recurrence id, recurrence rule, recurrence exception)

task ID start end recurrence id recurrence rule recurrence exception
1 2016-08-23 08:00:00.000 2016-08-23 08:30:00.000 NULL FREQ=DAILY 2016-08-24 08:00:00.000
2 2016-08-24 08:00:00.000 2016-08-24 08:00:00.000 1 NULL NULL


When above data send to scheduler no exception come and one extra appointment created.
I am using client side scheduler. Is above mechanism correct?
How scheduler understand the task id =2 are deleted
Please suggest or provide link for both functionality i.e. (delete/Edit) of Kendo scheduler Occurrence  
Thanks 
Georgi Krustev
Telerik team
 answered on 23 Aug 2016
1 answer
3.0K+ views

hello there

I´m running into a strange kendo error when my code is updating the grid,  but it only happens sometimes

but never after a refresh of the page only when data has been added once to the grid and then I´m getting a new datasource and adding it to the grid then this happens sometims

 

the probelm lies in this function:

_hideResizeHandle: function() {
                this.resizeHandle && (this.resizeHandle.data("th").removeClass("k-column-active"),
                this.lockedContent && !this._isMobile ? (this.resizeHandle.off(We).remove(),
                this.resizeHandle = null ) : this.resizeHandle.hide())
            },

 

I´ve attached a picture of the error

Stefan
Telerik team
 answered on 23 Aug 2016
1 answer
137 views
I need to fill background of cell based on it's value. For example, value of cell is 10%. I need left part of this cell to be blue and it part should be 10% of cell width. I also need to have same background after export to excel. It is possible to do this with kendo pivotgrid?
Georgi Krustev
Telerik team
 answered on 23 Aug 2016
3 answers
502 views

Given that I'm grouping the options by a property like "Country"

When the widget is rendered too narrow

And/or the group label is too wide

Then the option label is eclipsed by the group name.

 

Example: http://dojo.telerik.com/AsENi

 

Tiho
Top achievements
Rank 1
 answered on 22 Aug 2016
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?