Telerik Forums
Kendo UI for jQuery Forum
4 answers
511 views

I have a grid and I've created a custom compare routine for one of the columns. When I click the header (sorting ascending) the data is sorted and the UI reflects the newly sorted ordering. I can tell that my compare method is being called and since the sort order is correct, that it is correct. When I click the header again, while I see that the compare method is called, and it is returning the correct values, the UI does not update to reflect the descending sort ordering. There are no javascript errors reported, so I am at a loss - it seems that all the parts are working except that the UI is not updating properly.

If anyone has any ideas on things I can check and/or try, I'd appreciate your help.

Mark
Top achievements
Rank 1
 answered on 06 Sep 2016
1 answer
101 views

For autoComplete dataItem takes only number, but valid parameter is also JQuery.

select: (e) =>
            {
                let di = e.sender.dataItem(e.item);

Rumen
Telerik team
 answered on 06 Sep 2016
3 answers
162 views

Hi,

we are using Kendo Professional in an SPA application (only JS and WebApi) and we have a couple use cases of localization that we cannot achieve using documented methods and practices, so we are turning to this forum for help.

What we have now

We use mainly MVVM and already have a setup that allows us to load the correct culture/messages files and replace data-attributes that contain text with the updated strings; sometimes we have non-mvvm widgets that we call setOptions on manually.

We also have about a dozen custom widgets with texts in options like:

options: {
    name: "...",
    windowTitle: null,
    windowHeight: "50%",
    windowWidth: "50%",
    placeholder: null,
    inputPlaceholder: null,
    resultsPlaceholder: "Type something in the above field",
    ...
}

First use-case: complete app-localization

  1. What is the right approach to localize widget options? Like input placeholders, windows titles, etc ...
  2.  Is there a way to refresh widgets' data-attributes? (could calling setOptions for every widget, with the new parsed options from the element, be a solution?)

We have looked at stackoverflow, general blogs and this forum but no one seems to have a proposed solution. Only this thread was heading in the right way but it died years ago.

We don't want to put resources in viewmodels because we'd have to refactor many views and because a viewmodel should not be aware of what widget is currently rendered.

Second use-case: single view layout change

We have a custom view (with a single viewmodel) that should have different layout based on a user-selection, currently we are doing this:

  1. calling kendo.destroy/unbind on the #view
  2. replacing the innerHTML of the #view
  3. calling kendo.bind(#view, viewmodel)

This is leading to big memory leaks and general bad performances after 3/4 executions.

What is the correct way of doing this?

Third use-case: single view/widget localization

Additionally, we have a single view that should be localized independently from the rest of the application; currently we are doing as indicated in theuse case nr 2 (destroy, update data-attributes, bind again); we know that this won't localize dates/currencies but we have only custom widgets in this view so it is not a problem for now.

This is causing the same memory leak as above that leads to several Megabytes (if not a Gigabyte) if used ram for the single chrome page if this function is called more than 6-10 times in a row, and the browsed becomes unusable after less than 10 times.

This could be replaced with a setOptions on all the fields if was implemented something like a kendo.refresh($element) that re-parses all data-attributes and calls setOptions.

 

Thank you in advance.

Fabio
Top achievements
Rank 1
 answered on 06 Sep 2016
1 answer
94 views

Hello

There is a bug in vertical gauge margins we have come across when assigning margins which have different vertical and horizontal lengths.

On line 1079 of kendo.dataviz.gauge.js there is the following:

var bbox2d = new dataviz.Box2D(bboxX, bboxX,

This should be

var bbox2d = new dataviz.Box2D(bboxX, bboxy,

Thanks,

Ben

Rumen
Telerik team
 answered on 06 Sep 2016
1 answer
124 views

I am trying to set menu (ul element) z-index bellow the window and all children (on root item hover - .k-animation-container) greater then window z-index.

I try to set .k-animation-container z-index higher then window, but it doesn't work.

How can I display menu root items bellow window and all non-root items (everything that opens, including popup menu) above window?

Dojo.

Dimiter Topalov
Telerik team
 answered on 06 Sep 2016
1 answer
165 views

My spreadsheet loads fine, but the order in which it loads the columns is odd based on the datasource I'm pulling from. I'd like to specify the order they're in, as well as the name of said columns.

 

I have the following code:

///////////////
                        $("#spreadsheet").kendoSpreadsheet({
                            columns: 17,
                            columnWidth: 100,
                            rows: 100,
                            
                            toolbar: true,
                            sheetsbar: true,
                            excel: {                
                                // Required to enable Excel Export in some browsers
                                proxyURL: "//demos.telerik.com/kendo-ui/service/export"
                            },
                            sheets: [{
                                name: "Summary",
                                dataSource: summaryDS
                                
                            },{
                                name: "Customers",
                                dataSource: customersDS,
                                    columns: [
                                        {
                                            field: "nummer",
                                            title: "Number"
                                        },
                                        {
                                            field: "ans",
                                            title: "Customer"
                                    }]
                                
                            },{
                                name: "Prospects",
                                dataSource: prospectsDS
                            },{
                                name: "Leads",
                                dataSource: leadsDS
                            }]
                        });
                    ///////////////

 

 

Boyan Dimitrov
Telerik team
 answered on 06 Sep 2016
3 answers
312 views

I have a grid with custom editors (kendo datepicker, kendo numericTextBox) and one field that does not have a custom editor defined

When I am in edit mode, and change the value in either of columns using custom editor templates, the dataItem.dirty flag is not changed. It is only correctly tracked in the default editor.

 

columns: [
{
    field: "amount",
title: "Amount (bps)",
//editor: function(container, options){
// container.append(amountTemplate);
//}
},
{
field: "startDate",
title: "Start Date",
template: startDateTemplate,
editor: function(container, options){
container.append(startDateTemplate);
}
},
{
field: "endDate",
title: "End Date (months)",
template: '<span ng-if="!dataItem.isBeingEdited">{{!!dataItem.endDate ? dataItem.endDate : "&boxh;"}}</span>',
editor: function(container, options){
container.append(endDateTemplate);
}
}​

Plamen
Telerik team
 answered on 06 Sep 2016
10 answers
807 views
I try to change the background color if some value below 10.

like:
function getFormat (val,name) {
        if (val> 10) {
            return name;
        }
        else {
            return "<div style='background:red'> "+ name +" </div>"
        }
    }
Then I use a template that call this function.
That work good, but I lost the "isDirty" flag for all my cell. 
I use the gris in editable=true (batch editing).

Second try:
It is possible to intercept an event when the row is created, then got the row data to do some calculation and then add a "isDirty" custom flag (in the opposite corner)? Without login the "normal" isDirty indicator.

Thanks
Raviraj
Top achievements
Rank 1
 answered on 06 Sep 2016
1 answer
117 views

Hi,

when using angular syntax inside chart template it is getting displayed as string.  Sample

    $scope.text = "hi";
    $scope.valueAxisConfig = {
    labels: {
      template: '{{text}}#= kendo.toString(value, \'c0\') #'
    }
}

Rumen
Telerik team
 answered on 06 Sep 2016
1 answer
154 views

Hi,

we are refactoring a rather big ViewModel in order to make it more maintainable and we are splitting it in smaller objects but we are running in some problems of context when dealing with bound events in the UI.

Here is a bare example of our current situation.

With a binding like this:

<button data-bind="click: person.personMethod">personMethod</button>

we have this ViewModel (it is TypeScript 1.8 compiled to ES5):

/// <reference path="jquery.d.ts" />
/// <reference path="kendo.all.d.ts" />
class Person extends kendo.data.ObservableObject {
    public personName = "John Doe";
    private age = 65;
    constructor() { super(); super.init(this); }
    public personMethod(e) {
        alert(this.personName); /* NOT POSSIBLE as 'this' is the ROOT VIEWMODEL */
        alert(e.data.personName); /* NOT POSSIBLE as 'e.data' is the ROOT VIEWMODEL */
         
        /* How to reference 'personName'? */
         
        /* this is the hack that I am using now */
        const that = (this instanceof ViewModel)
            ? (<ViewModel><any>this).person
            : this;
 
        /* but it is ugly and it does not permit to access private properties */
        alert(that.age); /* NOT POSSIBLE BECAUSE IS PRIVATE */
    }
}
class ViewModel extends kendo.data.ObservableObject {
    public person = new Person();
    constructor() { super(); super.init(this); }
}

I have written the issues into the comments.

What are your thought on this approach? Is there a recommended way to deal with big ViewModels?

 

Thanks.

Petyo
Telerik team
 answered on 06 Sep 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
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
SmartPasteButton
PromptBox
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?