Telerik Forums
Kendo UI for jQuery Forum
4 answers
2.6K+ views

I have a custom button on scheduler's toolbar and on "onclick" event I'm calling function "openEditor()". Inside this function I want to call a `text/x-kendo-template` script type. How can I do this?

My code right now:

Custom button:

schedulerToolbar.append(
"<ul class='k-reset'>
   <li class='k-state-default'>
     <a role='button' href='#' class='k-link newMeetingButton' onclick='openEditor()'>
       Nova reserva
     </a>
   </li>
</ul>"
)

Function openEditor():

function openEditor() {
   *code to call customEditorTemplateBh script*
 }

Template script:

<script id="customEditorTemplateBh" type="text/x-kendo-template">
   *template code*
</script>

 

Allan
Top achievements
Rank 1
 answered on 24 Jul 2017
4 answers
687 views

Hello I have 2 problems:

1) When click a file upload button my  opens. If I open a  from inside that one, the new window opens behind the first one, even though it is modal. How do you force a  to open in front? See below:

this.m_oDlg.kendoWindow(
{
actions: [],
title: "Edit Document",
draggable: true,
width : 840,
height : 580, 
resizable : false,
scrolling : false,
modal : true,
open: function(e){
// OK Button
var divText = "<div style='float:right;'>";
divText += "<button title='OK' id='editorOK' class='k-button basicModalDialogButton' style='paddingTop: 5px;'>OK</button>";
divText += "</div>";
$("#docEditor").append(divText);

//Cancel Button
var divText1 = "<div style='float:right;'>";
divText1 += "<button title='Cancel' id='editorCancel' class='k-button basicModalDialogButton' style='paddingTop: 5px;'>Cancel</button>";
divText1 += "</div>";
$("#docEditor").append(divText1);

var win = this;
$("#editorCancel").click(function(){
win.close();
});
$("#editorOK").click(function(){
ProStarAPI.DocEditorDlg.onOK;
win.close();
});
}
});
//this.m_oDlg.data("kendoWindow").center().open();
var win = $("#docEditor");
win.data("kendoWindow").open();

2) The buttons declared in the open event disappear if i close the window and re-open it. 

Any help would be greatly appreciated. Thanks

Nencho
Telerik team
 answered on 24 Jul 2017
2 answers
130 views

Reproduction

See dojo here: http://dojo.telerik.com/EdAdA

You can see I've disabled the top 2 cells in the ID column, now apply a sort from the filter menu.

Notice the enable state doesn't follow the cell it was applied on, instead it stays where it was initially loaded.

Issue

When certain cells are disabled (enable: false), that state doesn't follow the cell when the sort is applied.

Veselin Tsvetanov
Telerik team
 answered on 24 Jul 2017
1 answer
313 views

I have a custom popup grid edit window that displays some related fields. I hide these fields when creating a new record, as the record id is not created until the record is saved.

Currently users need to save the record and then click again to edit it to be able to see the related fields. Is it possible to keep the popup window open after creating the record and receiving the id back from the server?

Stefan
Telerik team
 answered on 24 Jul 2017
7 answers
256 views

Hello, 

We have a grid that row mode filter is enabled and data source model has a field that has type as object. After we used the 2017 r2 release this grid is not loading correctly. Below you can find a sample code block that demonstrates this issue on dojo.

function renderStores(stores) {
    if (typeof stores != "undefined" && stores != null) {
        var template = "<ol>";
        for (var i = 0; i < stores.length; i++)
            template = template + "<li>" + stores[i] + "</li>";
        return template + "</ol>";
    } else {
        return "";
    }
}
$(document).ready(function () {
    $("#grid").kendoGrid({
        dataSource: {
            data: products,
            schema: {
                model: {
                    fields: {
                        ProductName: {
                            type: "string"
                        },
                        UnitPrice: {
                            type: "number"
                        },
                        UnitsInStock: {
                            type: "number"
                        },
                        Discontinued: {
                            type: "boolean"
                        },
                        Stores: {
                            type: "object"
                        }
                    }
                }
            },
            pageSize: 20
        },
        height: 550,
        scrollable: true,
        sortable: true,
        filterable: {
            mode: "row"
        },
        pageable: {
            input: true,
            numeric: false
        },
        columns: [
            "ProductName",
            {
                field: "UnitPrice",
                title: "Unit Price",
                format: "{0:c}"
            },
            {
                field: "UnitsInStock",
                title: "Units In Stock"
            },
            {
                field: "Discontinued"
            },
            {
                field: "Stores",
                template: "#=renderStores(Stores)#",
                filterable: {
                    cell: {
                        template: function (args) {
                            console.log(args.element);
                        }
                    }
                }
            }
        ]
    });
});
var products = [{
    ProductID: 1,
    ProductName: "Chai",
    SupplierID: 1,
    CategoryID: 1,
    QuantityPerUnit: "10 boxes x 20 bags",
    UnitPrice: 18.0000,
    UnitsInStock: 39,
    UnitsOnOrder: 0,
    ReorderLevel: 10,
    Discontinued: false,
    Category: {
        CategoryID: 1,
        CategoryName: "Beverages",
        Description: "Soft drinks, coffees, teas, beers, and ales"
    },
    Stores: ["Store 1", "Store 2", "Store 3"]
}, {
    ProductID: 2,
    ProductName: "Chang",
    SupplierID: 1,
    CategoryID: 1,
    QuantityPerUnit: "24 - 12 oz bottles",
    UnitPrice: 19.0000,
    UnitsInStock: 17,
    UnitsOnOrder: 40,
    ReorderLevel: 25,
    Discontinued: false,
    Category: {
        CategoryID: 1,
        CategoryName: "Beverages",
        Description: "Soft drinks, coffees, teas, beers, and ales"
    },
    Stores: ["Store 1", "Store 2", "Store 3"]
}, {
    ProductID: 3,
    ProductName: "Aniseed Syrup",
    SupplierID: 1,
    CategoryID: 2,
    QuantityPerUnit: "12 - 550 ml bottles",
    UnitPrice: 10.0000,
    UnitsInStock: 13,
    UnitsOnOrder: 70,
    ReorderLevel: 25,
    Discontinued: false,
    Category: {
        CategoryID: 2,
        CategoryName: "Condiments",
        Description: "Sweet and savory sauces, relishes, spreads, and seasonings"
    },
    Stores: ["Store 1", "Store 2", "Store 3"]
}];

What is the correct way to fix this issue?
Regards.

Konstantin Dikov
Telerik team
 answered on 24 Jul 2017
3 answers
412 views

I have a diagram where I change the height from javascript on page resize like so:

$("#diagram").height(xxx);

When I call this, the height is applied as I can see the diagram's border cover the larger area.  This works fine when resizing the browser window by dragging a corner to resize. However, when I maximize the window, the diagram resizes, however the content in the lower part of the diagram remains hidden.

For example,if when I maximize the browser, the diagram becomes 100 pixels taller, the bottom 100 pixels of the diagram is empty - I cannot even drag shapes into that area.  If I resize via dragging the browser corner, it fixes itself again.

I attached screenshots that describe the behavior.

Is their any workaround you can think of?

 

 

 

Stamo Gochev
Telerik team
 answered on 24 Jul 2017
3 answers
415 views

I want to change the dots to how many else events in that day ,show like one more event will show +1

How to do that?

Ivan Danchev
Telerik team
 answered on 24 Jul 2017
2 answers
265 views

Hi,

May i know how can i loop the series data in JQuery Kendo Chart? I need to loop because i need to check if the series point exceed some limit and i need to change the behavior of the point by changing it label or color. i know there is a parameter called render and we can check the value there.

Sharizan
Top achievements
Rank 1
 answered on 24 Jul 2017
3 answers
579 views

Hi team,

I'm wondering if there is a way to pop-up a notification dialog on Kendo Window closing to warn user about unsaved changes, and allow them to choose between continue closing anyway and undo the closing command so they can save their change? Just like the Page Close Notification dialog?

 

Best,

 

Anna

Anna
Top achievements
Rank 1
 answered on 21 Jul 2017
2 answers
245 views

Is there a easy way to disable spinners for numeric textbox?

Somenthing like:

spinners: false

 

Ricardo Lavor
Top achievements
Rank 1
 answered on 21 Jul 2017
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?