Telerik Forums
Kendo UI for jQuery Forum
1 answer
239 views

Hi,

I use Upload to select multiple files. I don't want to use web services to process the upload, so my code for Upload creation looks like this:

$('#uploader').kendoUpload({
    async: {
        saveUrl: "notNeeded",
        removeUrl: "notNeeded",
        autoUpload: false
    }
});

When I select some files, there is a list of the selected files. Under the list there are buttons Clear and Upload.

I want to perform some action when Clear is clicked, but I don't know how to detect it.

Listening to "remove" event did not help.

Thanks for the answers,

Boris

 

dddd

Dimiter Madjarov
Telerik team
 answered on 04 Nov 2016
13 answers
325 views
The MaskedTextBox does not appear to work in the latest version of Android browsers.  I can't even get the demo on your website to work using Chrome on Android 4.4.2.

http://demos.telerik.com/kendo-ui/maskedtextbox/index

The user agent string is:  Mozilla/5.0 (Linux; Android 4.4.2; en-us; SAMSUNG SCH-I545 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.5 Chrome/28.0.1500.94 Mobile Safari/537.36

Am I missing something?

Thanks
Georgi Krustev
Telerik team
 answered on 04 Nov 2016
1 answer
1.3K+ views

Hello,

I have a grid with checkboxes. I am using the template feature to show a checkbox if there is a checked flag. By default Kendo recognizes the true / false to enable the checkbox. I have type: boolean in the schema.

My problem: The datasource that is provided to me, will only display 'Y' or 'N' for these boolean values.

In edit mode, how can I keep the checkboxes but use the template to recognize these new values? Clicking edit will display a textbox instead of the checkbox (If I set the scheme to "string" so that the template will recognize the "Y" & "N" values. Please help!

http://dojo.telerik.com/AdUqE

Orlin
Telerik team
 answered on 04 Nov 2016
3 answers
3.9K+ views

I have a grid which I define declaratively. It works well except that the column sorting interprets the columns as strings, whereas I wish for some columns to be sorting as numerical values.

 

Below is my grid definition.

The column I am interested in sorting in numerical order is "incident_count". I have tried specifying a type: "number" attribute to the column but it did not work.

 

<div id="PatrolRecords">
    <div data-filterable='{ "mode": "row" }'
         data-role='grid'
         data-sortable='true'
         data-detail-template='patrolDetailTemplate'
         data-detail-init='detailInit'
         data-bind='source: reportData.Patrols, events: {excelExport: excelExportHandler}'
         data-pageable='{ "pageSize": 10 }'
         data-toolbar='["excel"]'
         data-excel='{ "fileName": "Patrols.xlsx", "allPages": "true" }'
         data-columns='[
               {
                    field: "patrol_id_plain",
                    title: "Patrol ID",
                    filterable: false,
                    width: 70
                },
                {
                    field: "tour_name",
                    title: "Tour",
                    filterable: { cell: { operator: "contains" } }
                },
                {
                    field: "location_name",
                    title: "Location",
                    filterable: { cell: { operator: "contains" } }
                },
                {
                    field: "client_company",
                    title: "Company",
                    filterable: { cell: { operator: "contains" } }
                },
                {
                    field: "address",
                    title: "Address",
                    template: kendo.template($("#addressTemplate").html()),
                    filterable: { cell: { operator: "contains" } }
                },
                {
                    field: "end_date_seconds",
                    title: "Date & Time",
                    template: kendo.template($("#dateTemplate").html()),
                    filterable: false
                },
                {
                    field: "patrolled_by",
                    title: "Patrolled By",
                    filterable: { cell: { operator: "contains" } }
                },
                {
                    field: "checkpoints",
                    title: "Checkpoints",
                    template: kendo.template($("#checkpointsTemplate").html()),
                    filterable: false,
                    width: 90
                },
                {
                    field: "incident_count",
                    title: "Incidents",
                    filterable: false,
                    type: "number",
                    width: 70
                },
                {
                    title: "GPS",
                    template: kendo.template($("#gpsTemplate").html()),
                    filterable: false,
                    width: 50
                },
                {
                    title: "",
                    template: kendo.template($("#viewLinkTemplate").html()),
                    filterable: false,
                    width: 60
                },
        ]'>
    </div>
</div>

Rosen
Telerik team
 answered on 04 Nov 2016
2 answers
505 views

I am using Kendo grid with editable popup and I want to hide/not use the row which is showing editing changes on runtime. 

Reason:  

I have a kendo multiselect control in popup and on saving data it adds multiple rows in db and it should show in grid as well. That's why I don't want to show that editing changes line. 

 

Stefan
Telerik team
 answered on 04 Nov 2016
6 answers
240 views
Is this the proper way of updating the data for a kendo treeview? If that's the case, then why am I getting some major memory leaks (according to Chrome's allocation profile)? And when I say 'major', I mean relative to our tiny sample data, obviously :).
Am I missing something?

<!DOCTYPE html>
<html>
<head>
  <title></title>
 
  <script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s="   crossorigin="anonymous"></script>
 
</head>
<body>
<div id="example" ng-app="KendoDemos">
  <div ng-controller="MyCtrl">
     
    <!-- generate new data and update the datasource-->
    <button ng-click="generate()">Generate</button>
 
    <div kendo-tree-view="treeApi" k-data-text-field="'name'"
         k-data-source="datasource" k-load-on-demand="false">
    </div>
 
  </div>
</div>
 
<script>
  angular.module("KendoDemos", [ "kendo.directives" ])
         .controller("MyCtrl", function($scope) {
 
        $scope.datasource = new kendo.data.HierarchicalDataSource({
            sort: { field: "name", dir: "asc" },
            data: [],
            schema: {
                model: {
                    id: 'id',
                    children: 'items'
                }       
            }
        });
         
        $scope.generate = function() {
            var data = [{
                id: 1,
                name: 'name',
                items: [{
                    id: 2,
                    name: 'name',
                    items: [{
                        id: 3,
                        name: 'name',
                        items: [{
                            id: 4,
                            name: 'name',
                            items: []
                        }]
                    }]
                }, {
                    id: 5,
                    name: 'name',
                    items: [{
                        id: 6,
                        name: 'name',
                        items: [{
                            id: 7,
                            name: 'name',
                            items: []
                        }]
                    }]
                }]
            }];     
             
            $scope.datasource.data(data);
        };
 
        $scope.generate();
    });
 
</script>
 
</body>
</html>

Dojo: http://dojo.telerik.com/EyuwU/3
Plamen
Telerik team
 answered on 04 Nov 2016
6 answers
708 views

Hi, 

 

I have my kendo upload widget (via angular) defined as:

<input name="files"<br>    id="files"<br>    type="file"<br>    kendo-upload="uploader"<br>    k-options="uploadOptions"<br>    k-template="kendoTemplate()"<br>    k-rebind="initialFiles"/>

 

I display all the files using initial files option. My objective is to continue to display the list of all files I get from server; once a given file is uploaded.

 

Because I have the rebind set on $scope.initialFiles; in onSuccess (I also tried onComplete)

I do:

 

<p>function onSuccess(e) {</p><p>    $scope.initialFiles.length = 0;<br>    populate();<br>}</p>

 

where the populate function uses $http service to get data and re-populate $scope.initialFiles...

This works fine with "drag and drop" functionality...but when I upload using the "Select..." button (I've renamed it to "Browse Files").. I get the error:

"Cannot read property 'get' of undefined"

It happens in kendo.min.js (appreciate this is minified code but pasting to give the context). I have marked the line that throws the error. 

<p>          function g(t, n, i, r, o, a, s) {<br>                var l = n.$watch(o, function(o, c) {<br>                    var d, u, h, f;<br>                    t._muteRebind || o === c || (l(),<br>                    d = B[t.options.name],<br>                    d && d.forEach(function(t) {<br>                        var i = n.$eval(s["k" + t]);<br>                        i && r.append(e(i).attr(kendo.toHyphens("k" + t), ""))<br>                    }),<br>                    u = e(t.wrapper)[0],<br>                    h = e(t.element)[0],<br>                    f = i.injector().get("$compile"), //**** this line throws the error<br>                    t._destroy(),</p><p></p>

I need to rebind the widget because after the upload; if I do not do $scope.initialFiles.length = 0;I do not get the current status of files. For example: if the user uploaded text.txt and then in order to overwrite the existing test.txt; reuploaded the same file - although its overwritten on the server - the UI continues to show two instances of text.txt. 

 How can I best; re-create the upload widget after the upload finishes (note I get the same error with onSuccess and onComplete) so that the list of files shown is only what's in $scope.initialFiles and fix the error I am getting now. The impact of error is that the widget does not get recreated...

 

Thanks a lot, 

 

Labhesh

 

Dimiter Madjarov
Telerik team
 answered on 03 Nov 2016
1 answer
515 views

I know this issue has been brought up a number of times, and the generally accepted method of dealing with it is to add some code that causes the grid content height to be increased and the grid to scroll up.  My situation is slightly different because we do not use the scrollbar, but instead, have the grid take up as much room as needed. The user then uses the browser's scrollbar to reach the bottom of the grid.  We do, however, include pagination at the bottom.

So, I have tried using the approach where the sizing is changed as recommended.  This gives me the height I need.  There are two issues that have come up, though.  

The first is that I am unsure when to add the focusout event handler.  If I add it as part of the dataBinding or dataBound events on the grid, then I end up with this event being called multiple times if the user decides to resort the data in the grid, etc. If I add it during the $onInit method in my component (I'm using Angular), then it throws an error because there is no data in the grid. Where do you recommend adding this handler?

The second is that once an error has occurred, the additional space is now part of the grid.  Do I really need to call another event handler to remove this space on the cancel or update events?

Here is the method I am using. It would help if I could find a way to streamline this, too, so that it only ran on the last row.

function allowValidationShow() {
    var grid = $('#grid').data("kendoGrid");
    grid.table.on('focusout', '.k-invalid', adjustGridHeight);
}
 
function adjustGridHeight() {
    var content = $('#grid').find('.k-grid-content');
    var height = content.height();
    var cell = $(this).closest('td');
    var message = cell.find('.k-invalid-msg');
    var callout = message.find('.k-callout');
    var position = message.position();
    var top = position.top + callout.outerHeight() + message.outerHeight();
    if (top > height) {
        content.height(top);
    }
}

This would be a lot easier to use if there were only a way to ensure that the validation tooltip could be ABOVE the pagination.  Then, no additional code would be needed.

Thanks for your help!

Stefan
Telerik team
 answered on 03 Nov 2016
1 answer
82 views

I'll explain better...

I have a grid and when I add the 

filterable: {
    mode: "row"
},

 

it adds the hidden columns and throws the whole layout of the grid off.. Please see attachment ss1.png, as well if you hover over the filter field you can notice a shift in size.. However the issue is why the filterable attribute messes up the grid?

here is my grid

function ShowGroupGrid(userdata) {
 
    $("#GroupGrid").kendoGrid({
        noRecords: {
            template: "No Records Available"
        },
        dataSource: {
            data: userdata
        },
        schema: {
            model: {
                fields: {
                    GroupID: { type: "number" },
                    LocationID: { type: "number" },
                    Group: { type: "string" },
                    Location: { type: "string" },
                    LocationNumber: { type: "string" },
                    Contact: { type: "string" },
                    Email: { type: "string" }
                },
            }
        },
        filterable: {
            mode: "row"
        },
        columns: [
            { title: "<input id='checkAll', type='checkbox', class='check-box' />", template: "<input name='Selected' class='checkbox' type='checkbox'>", width: "30px" },
            { hidden: true, title: "GroupID", field: "GroupID"},
            { title: "LocationID", field: "LocationID", hidden: true, filterable: { cell: { showOperators: false } } },
            { field: "Group", title: "Group", filterable: { cell: { showOperators: true, operator: "contains" } } },
            { field: "Location", title: "Location", filterable: false },
            { field: "LocationNumber", title: "Location Number", filterable: false },
            { field: "Contact", title: "Contact", filterable: false },
            { field: "Email", title: "Email", filterable: false }
        ],
        scrollable: true,
        height: 856
    });
}

 

Am I missing something? If I add this code to the Kendo Dojo then everything works fine.

I am using bootstrap with this as well and not sure if I have the correct CSS and JavaScript references in the right order or not.

 

Iliana Dyankova
Telerik team
 answered on 03 Nov 2016
1 answer
555 views

What is the correct referencing order and files to be referenced when using Bootstrap and KendoUI in html?

Right now I have a view that I guess you can call a masterpage, and I have referenced Bootstrap and KendoUI but I noticed when creating a grid, and adding filtering capability to it that I am getting two extra columns, as seen in attachment ss1.PNG .

However, when I add the code into KendoUI's dojo it looks normal, as seen in attachment ss2.PNG

 

So I am thinking that maybe I have my referencing in incorrectly

here is my "masterpage"


@{
Layout = null;
}
 
<!DOCTYPE html>
 
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Test</title>
<script src="~/Scripts/jquery-2.1.0.min.js"></script>
<script src="~/Scripts/Kendo.2016.1.226/kendo.all.min.js"></script>
<script src="~/Scripts/bootstrap.min.js"></script>
 
@Styles.Render("~/Content/css")
 
<link href="@Url.Content("~/Content/bootstrap.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/bootstrap.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/bootstrapValidator.min.css")" rel="stylesheet" type="text/css" />
 
<!--Kendo style-->
<link href="~/Content/Kendo.2016.1.226/kendo.default.min.css" rel="stylesheet" />
<link href="@Url.Content("~/Content/Kendo.2016.1.226/kendo.common.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/Kendo.2016.1.226/kendo.common-bootstrap.min.css")" rel="stylesheet" type="text/css" />
 
<link href="@Url.Content("~/Content/Custom/Layout.css")" rel="stylesheet" type="text/css" />
 
<link href="~/font-awesome-4.6.3/css/font-awesome.min.css" rel="stylesheet" />
<link href="~/Content/Custom/MyTest.css" rel="stylesheet" />
<link href="~/font-awesome-4.6.3/css/font-awesome.min.css" rel="stylesheet" />
<link href="~/Content/Custom/GlobalStyle.css" rel="stylesheet" />
 
</head>
<body>
<div class="container">
<div class="row">
<header>
<center><img src="~/Images/test-logo-sm.png" /></center>
</header>
</div>
<nav class="v-wrapper">
<ul>
<li class="v-brand">
 
<center><lh><label style="font-weight:bold; color:white;">Menu</label></lh></center>
</li>
<li>
<span class="glyphicon glyphicon-dashboard" style="color:green;"></span><a href="#" id="dashboard"> Dashboard</a>
</li>
<li>
<span class="fa fa-users" style="color:#003366;"> </span><a href="#" id="manageusers">Manage Login Users</a>
</li>
<li>
<span class="fa fa-group" style="color:orange;"> </span><a href="#" id="managegroups">Manage Groups</a>
</li>
<li>
<span class="fa fa-gears" style="color:red;"> </span><a href="#">Manage VS Equipment</a>
</li>
</ul>
</nav>
</div><!-- End Upper Container -->
  
<div class="container body-content">
<div class="row">
<div class="col-md-12 col-lg-12">
<h1>Blah</h1>
<p> This is where your main stuff goes</p>
</div>
</div><!-- End Row -->
</div><!-- End Main Container -->
<!-- Scripts -->
@*<footer class="footer"><p align="center">Footer Content Goes here</p></footer>*@
 
<script>
$(document).ready(function () {
$('#manageusers').click(function () {
$('.body-content').load("../ManageLoginUsers/ManageUsers");
});
 
$('#managegroups').click(function () {
$('.body-content').load("../ManageGroups/ManageGroups");
});
});
</script>
   
</body>
</html>



I can't get Bootstrap and KendoUI to play well together and I think it may have to do with my order of referencing all the CSS and Scripts. 

So what is the correct order?

 

Iliana Dyankova
Telerik team
 answered on 03 Nov 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
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?