Telerik Forums
Kendo UI for jQuery Forum
1 answer
255 views
In the following example also available at http://dojo.telerik.com/UsaG the grid seems to duplicate filters.

1) Change language and search text in the top right corner: filters (logged in the browser console) seem to operate properly;
2) As soon as you add/remove filters in the grid's filter toolbar, filters keep adding instead of replacing (see description and browser console).

Please correct if I am doing something wrong.

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>Datasource</title>
    <style>
        .toolbar { float: right; }
    </style>
</head>
<body>
<div data-role="grid" data-bind="source:list" data-pageable="{refresh:true,pageSizes:true,buttonCount:5}" data-filterable=true data-sortable=true data-resizable=true
     data-toolbar="[{template: kendo.template($('#toolbar-template').html())}]"
     data-columns="[{field:'id'},{field:'title'},{field:'description',width:420},{field:'userName'},{field:'created'},{field:'minAge',width:100},{field:'maxAge',width:100}]"></div>
<script type="text/x-kendo-template" id="toolbar-template">
    <div class="toolbar">
        <label for="language">Language:</label>
        <select id="language">
            <option value="fr">French</option>
            <option value="en" selected>English</option>
        </select>
        <label for="search">Search:</label>
        <input type="search" id="search" placeholder="Search..." class="k-textbox"/>
    </div>
</script>
<script>
 
    function log(message) {
        if (window.console) {
            if ($.type(message) === 'string' && $.type(window.console.log) === 'function') {
                window.console.log(message);
            } else if ($.type(message) === 'object' && $.type(window.console.dir) === 'function') {
                window.console.dir(message);
            }
        }
    }
 
    $.ajax = function(options) {
        var dfd = $.Deferred();
        setTimeout(function() {
            dfd.resolve({
                total: 1,
                data: [{
                    id: '123456789012345678901234',
                    title: 'A simple test',
                    description: '',
                    language: 'en',
                    userName: 'Kendo UI',
                    created: (new Date()).toISOString(),
                    minAge: 0,
                    maxAge: 99
                }]
            });
        }, 0);
        return dfd.promise();
    }
 
    var dataSource = new kendo.data.DataSource({
        transport: {
            read: function(options) {
                log('Read transport');
                var filter = options.data.filter = options.data.filter || { logic: 'and', filters: [] };
                if ((filter.logic === 'or') || (filter.field && filter.operator && filter.value)) {
                    options.data.filter = {
                        logic: 'and',
                        filters: [
                            filter
                        ]
                    }
                }
                var language = $('#language').val();
                if ($.type(language) === 'string' && language.length === 2) {
                    options.data.filter.filters.push({ field: 'language', operator: 'eq', value:language });
                }
                var textSearch = $('#search').val();
                if ($.type(textSearch) === 'string' && textSearch.trim().length > 0) {
                    options.data.filter.filters.push({ field: '$text', operator: 'eq', value: textSearch.trim() });
                }
                console.log(options.data.filter);
 
                $.ajax({
                    url: "http://localhost:3000/api/v1/summaries",
                    dataType: "json",
                    cache: false,
                    data: options.data
                }).done(function(results) {
                    if ($.isArray(options.data.filter.filters)) {
                        results.data[0].description = kendo.format('Filter has {0} operators', options.data.filter.filters.length);
                    }
                    results.data[0].language = language;
                    options.success(results);
                }).fail(function(xhr, status, error) {
                    options.error(error);
                });
            }
        },
        serverFiltering: true,
        serverSorting: true,
        //sort: { field: "title", dir: "desc" },
        pageSize: 5,
        serverPaging: true,
        schema: {
            data: "data",
            total: "total"
        }
    });
 
    window.viewModel = kendo.observable({
        list: dataSource
    });
 
    $(document).ready(function() {
        kendo.bind('body', window.viewModel);
        $('#language').kendoDropDownList().data('kendoDropDownList')
            .bind('change', function() {
                log('Language changed to ' + this.value());
                window.viewModel.list.read();
            });
        $('#search')
            .on('change', function() {
                log('Search changed to ' + $(this).val());
                window.viewModel.list.read();
            });
    });
</script>
</body>
</html>

Alexander Popov
Telerik team
 answered on 03 Sep 2014
1 answer
161 views
Hi,

I just got a problem with the editor and I have no idea how i could resolve it. I can do custom tools or use default ones without any problems. The only thing I don't really understand is how to translate  the editor interface in differents languages. I found this project on the web, that translate some of the features but not all of them :

https://github.com/loudenvier/kendo-global

My editor must be multi-cultural, based on user language. With this github project, I can almost translate all the kendo editor features except for the style drop down ("heading 1", "heading 2", etc) and some tools like insterting a table ( "Create a i x j table", etc). These texts seems to be hardcoded inside the javascript file of kendo. 

So how could I change those texts dynamically?

Your help would be greatly appreciate.

Thx!
Alex Gyoshev
Telerik team
 answered on 03 Sep 2014
1 answer
193 views
I have two layouts, one has basic header, footer and the other one has drawer in it.  The idea is to have the basic header footer view to be the login view to ask user's login information.  Once it is authenticated against service, it will redirect to a view where it has drawer widget.  The question is how do I implement such layout? I've tried to put two layouts on the same html and use this to display default:

var app = new kendo.mobile.Application($(document.body), { layout: "login-layout" });

and place a <a href="#default-view">switch to default view</a> to switch to the view that has drawer layout.  Once it's witched the drawer widget seems not to work.  

What is the correct way to implement this?  thank you.
Kiril Nikolov
Telerik team
 answered on 03 Sep 2014
1 answer
130 views
I am using the TabStrip in a web application.  The first tab in the tabstrip does not format correctly -- it is outside the tab "div".  However, the second tab works correctly.

First tab is in screenshot "firstTab.png" and Second tab is in "secondTab.png"

As shown below, the code is exactly the same in each div tag for each tab that appears.

Here is my page/code I am using:
<html>
<head>
<script src="kendo/js/jquery.min.js"></script>
<script src="kendo/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="kendo/css/bootstrap-theme.min.css"
    type="text/css">
<link rel="stylesheet" href="kendo/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="kendo/css/kendo.bootstrap.min.css"
    type="text/css">
<link rel="stylesheet" href="kendo/css/kendo.bootstrap.mobile.min.css"
    type="text/css">
<link rel="stylesheet"
    href="kendo/css/kendo.common-bootstrap.core.min.css" type="text/css">
<link rel="stylesheet" href="kendo/css/kendo.common-bootstrap.min.css"
    type="text/css">
<link rel="stylesheet" href="kendo/css/kendo.common.core.min.css"
    type="text/css">
<link rel="stylesheet" href="kendo/css/kendo.common.min.css"
    type="text/css">
<link rel="stylesheet" href="kendo/css/kendo.default.min.css"
    type="text/css">
<link rel="stylesheet" href="kendo/css/kendo.default.mobile.min.css"
    type="text/css">
<link rel="stylesheet" href="css/clip.css" type="text/css">
<title>Proposal</title>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
</head>
<body>
    <div id="main-content">
        <div id="mainTable">
            <ul>
                <li>General Information</li>
                <li>Customer</li>
            </ul>
            <div id="generalTab">
<form class="form-horizontal" role="form">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">Bid Manager</label>
                        <div class="col-sm-6">
                            <input type="text" name="bidMan" class="form-control"
                                placeholder="Enter Bid Manager..." required
                                data-required-msg="Bid Manager is required."
                                data-bind="value: bidMan"></input>
                        </div>
                    </div>
</form>
            </div>
            <div id="customerTab">
<form class="form-horizontal" role="form">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">Bid Manager</label>
                        <div class="col-sm-6">
                            <input type="text" name="bidMan" class="form-control"
                                placeholder="Enter Bid Manager..." required
                                data-required-msg="Bid Manager is required."
                                data-bind="value: bidMan"></input>
                        </div>
                    </div>
</form>
            </div>
        </div>
        <script>
            $(document).ready(function() {
                                 
                // Selects first tab of tabStrip...
                var mainTable = $("#mainTable").kendoTabStrip().data("kendoTabStrip");
                mainTable.select(0);
 
            });    
        </script>
    </div>
</body>
</html>

Please let me know what I may have missed in this formatting.

Thanks!
Dan
Iliana Dyankova
Telerik team
 answered on 03 Sep 2014
2 answers
899 views
Hi,
I want to ask how many project I can use per license?

Can I use Splitter to create layout in the attachment?

Thanks,
Loi Tran
Sebastian
Telerik team
 answered on 03 Sep 2014
6 answers
731 views
I am trying to create something similiar to the Kindle Download page: https://read.amazon.com/, It has two buttons at the top: [CLOUD] [DOWNLOADED]

Each button can be in either a selected or non-selected state. There is always one selected (so they work as a radio button pair).

The color of the button indicates whether it is selected or not.

I like the way your CSS (MetroBlack) displays the button for button.k-state-focused, but my guess is you use that automatically, so if I click somewhere else it would lose that decoration. 

Is there a way I can put decoration on the button and have it "sticky" until I click it's pair (I would implement the radio button state logic in javascript), unless there is a brilliant way to do this in css!




Dimo
Telerik team
 answered on 03 Sep 2014
1 answer
126 views
Hello,

Is there an attribute for making the window centered automatically, without having to do that via javascript?

With Angular, something like "k-centered='true'":
<div kendo-window="someWindow"
      k-width="600" k-height="200" k-visible="true"
      k-centered="true">
</div>

If not, perhaps this can be added?

Thanks,
Lars
Alex Gyoshev
Telerik team
 answered on 03 Sep 2014
2 answers
180 views

Im using kendoUpload control to upload the file. Everything works fine in IE10, but as soon as I switch to IE8 mode the uploaded file size property remains null.
is it by design?

$importFiles.kendoUpload({
      async: {
          autoUpload: false,
          saveUrl: saveUrl,
          removeUrl: removeUrl
      },
      multiple: false,
      showFileList: true,
      select: (e: kendo.ui.UploadSelectEvent): void => {
          $selectMsg.show();
      },
      upload: (e: kendo.ui.UploadUploadEvent): void => {           
          var file: any = e.files[0];          
           
          // file.size is null in IE8
          if ((file.size != null) && (((file.size / 1024) / 1024) > allowedFileSizeInMB)) {
              showErrorModal('The selected file is too large.');
              e.preventDefault();
              $selectMsg.hide();
          }
      }       
  });
Dimiter Madjarov
Telerik team
 answered on 03 Sep 2014
1 answer
87 views
Hello,

im new in mobile HTML5 development. Im trying to use the split view. When now a link is clicked on the left pane, I just want to load a new view in the left pane and additional load another view on the main pane. How can I realize that?
Petyo
Telerik team
 answered on 03 Sep 2014
3 answers
327 views
I have a splitter that I need to hide or show based on certain conditions. I'm using angular's ng-show to hide and show the div containing the splitter.

If the window is resized while the splitter div is hidden, showing the div results in a 0 width first column.

I have seen similar issues on the forums that suggest triggering a resize on the splitter, but it doesn't work the way I'm trying to do it. I suspect that the resize is being triggered before the splitter is actually shown, but I'm not sure where else to put the resize trigger.

Sample code reproducing the issue is below. 

Thanks!

<!DOCTYPE html>
<html>
<head>
    <title>AngularJS</title>
    <meta charset="utf-8">
    <style>html { font-size: 12px; font-family: Arial, Helvetica, sans-serif; }</style>
    <link href="http://cdn.kendostatic.com/2014.2.716/styles/kendo.common.min.css" rel="stylesheet" />
    <link href="http://cdn.kendostatic.com/2014.2.716/styles/kendo.default.min.css" rel="stylesheet" />
    <link href="http://cdn.kendostatic.com/2014.2.716/styles/kendo.dataviz.min.css" rel="stylesheet" />
    <link href="http://cdn.kendostatic.com/2014.2.716/styles/kendo.dataviz.default.min.css" rel="stylesheet" />
    <script src="http://cdn.kendostatic.com/2014.2.716/js/jquery.min.js"></script>
    <script src="http://cdn.kendostatic.com/2014.2.716/js/angular.min.js"></script>
    <script src="http://cdn.kendostatic.com/2014.2.716/js/kendo.all.min.js"></script>
    <script>
        
    </script>
    
    
</head>
<body>
    
<div id="example" ng-app="KendoDemos">
  <div ng-controller="MyCtrl" style="width: 100%;">

      <h1>How can I trigger a splitter resize when ng-show makes the div visible?</h1>
      <h3>Calling $scope.mainSplitter.trigger("resize") when setting the visibility boolean doesn't work...</h3>
      <h4>
          <ol>
              <li>Click the button to hide the splitter.</li>
              <li>Resize the window.</li>
              <li>Click the button to show the splitter. First column has zero width.</li>
              <li>Resize the window again and observe the splitter resize.</li>
          </ol>
      </h4>
    <button ng-click="toggleVisible()">{{buttonText}}</button>
    <div class="box-col" style="width: 100%;" ng-show="isSplitterVisible">
      <div kendo-splitter="mainSplitter"
           k-panes="[ { size: '100px' }, null]"
           k-orientation="horizontal">
        <div>
          <p>Pane 1</p>
        </div>
        <div>
          <p>Pane 2</p>
        </div>
      </div>
    </div>
  </div>
</div>

    <script>
      angular.module("KendoDemos", [ "kendo.directives" ]);

      function MyCtrl($scope) {
          $scope.isSplitterVisible = true;
          $scope.buttonText = "Hide Splitter";

          $scope.toggleVisible = function()
          {
              $scope.isSplitterVisible = !$scope.isSplitterVisible;
              if ($scope.isSplitterVisible){
                  // Splitter is visible. Try to trigger a resize
                  $scope.mainSplitter.trigger("resize");

                  // Change the button text
                  $scope.buttonText = "Hide Splitter";
              }
              else{
                  // Change the button text
                  $scope.buttonText = "Show Splitter";
              }
          }
      }
    </script>

</body>
</html>
Jon
Top achievements
Rank 1
 answered on 03 Sep 2014
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?