Telerik Forums
Kendo UI for jQuery Forum
2 answers
83 views
As far as I have seen the resize event of the splitter happens even while the page itself is loading which by itself I understand why.

The problem for me is I want to make a post ajax call to save the splitter size and I want to minimize the calls to resize events the application user triggers while resizing the pane with the mouse only.

How would one go about that since I've noticed the layoutChange event is getting deprecated soon and I don't want to rely on something that's not going to be there in a next revision :)
Dimo
Telerik team
 answered on 14 Feb 2014
1 answer
69 views
Can I change the first row from days to technical's names?
I need to show the technical's appointments by day and hours in the left side as default.
Similar to ScheduleView from Silverlight (http://demos.telerik.com/silverlight/#ScheduleView/FirstLook). Where my technical's names would be Channels TV in this example.

Is it possible? How can i do it?
Alexander Popov
Telerik team
 answered on 14 Feb 2014
7 answers
417 views
Hi,

I have a view with a canvas on it and a drawing. I would like to change the size on the canvas and redraw the contents when the device orientation event triggers.

So if in Portrait I would like to redraw in Landscape and vice versa.

How do I link the  device orientation change to the current view so that I can resize the canvas and redraw the contents ?

cheers
Tony
Kiril Nikolov
Telerik team
 answered on 14 Feb 2014
1 answer
266 views
Hi Georgi,you are right, using the text method is not the right way.

On the other side, there is something wrong with cascading comboboxes in Kendo UI.

Please look at my attached sample (click on ComboBox in top menu).
[ComboBox.zip]

The ViewModel I'm using:

public class ComboBoxViewModel
{
    public string MyProperty1 { get; set; }
    public string MyProperty2 { get; set; }
    public Product Product { get; set; }
    public int ProductID { get; set; }
}


In the view I'm using two comboboxes. One for products

  <div class="form-group">
      @Html.LabelFor(model => model.ProductID, new { @class = "control-label col-md-2" })
      <div class="col-md-10">
          @(Html.Kendo().ComboBoxFor(model => model.ProductID)
.CascadeFrom(Html.IdFor(model => model.Product.Category).ToString())
            .Placeholder("Select state or province...")
            .DataTextField("ProductName")
            .DataValueField("ProductID")
            .Filter(FilterType.Contains)
            .DataSource(source =>
            {
                source.Read(read =>
                {
                    read.Action("GetCascadeProducts", "ComboBox")
                        .Data("filterProducts");
                }).ServerFiltering(true);
                ;
            })
            .AutoBind(false)
            .HighlightFirst(true)
            .Enable(false)
          )
          @Html.ValidationMessageFor(model => model.ProductID)
          <script>
              function filterProducts() {
                  return {
                      categories: $("#@Html.IdFor(model => model.Product.Category.CategoryID).ToString()").val(),
                      productFilter: $("#@Html.IdFor(model => model.ProductID)").data("kendoComboBox").input.val()
                  };
              }
          </script>
      </div>
  </div>


and one for category (as a filter for products)

<div class="form-group">
            @Html.LabelFor(model => model.Product.Category, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @(Html.Kendo().ComboBoxFor(model => model.Product.Category.CategoryID)
                  .Name(Html.NameFor(model => model.Product.Category).ToString())
                  .Placeholder("Select category ...")
                  .DataTextField("CategoryName")
                  .DataValueField("CategoryID")
                  .Filter(FilterType.Contains)
                  .DataSource(source =>
                  {
                      source.Read(read =>
                      {
                          read.Action("GetCascadeCategories", "ComboBox").Type(HttpVerbs.Post);
                      });
                  })
                )
            </div>
        </div>


My problem is, that the product combobox is empty on initial page load, because the parameter productFilter is not empty. It is set with the value of  ProductID, and therefore the returned product list must be empty!

<script>
    function filterProducts() {
        return {
            categories: $("#@Html.IdFor(model => model.Product.Category.CategoryID).ToString()").val(),
            productFilter: $("#@Html.IdFor(model => model.ProductID)").data("kendoComboBox").input.val()
        };
    }
</script>


My feeling is, that there must be something wrong here with Kendo ComboBoxes.

How can I solve this scenario?
The ComboBox with products should be filled with all products of category Beverages and show "Chai" as a selected product on initial load. (See Scree2.png)

Telerik support provide me with a solution (see Telerik.zip) that doesn't work for me.

Regards,
Daniel

You can find all my files here: http://1drv.ms/1cDgIZZ

Georgi Krustev
Telerik team
 answered on 14 Feb 2014
3 answers
293 views
I've noticed that while at first the android back button (as on an android device) and the kendo mobile back button appear to work the same way, when you use a combination of both you get different behaviour. Let's see how I go at explaining what I mean...

I have 3 views; view-a, view-b and view-c. I start the application and the initial view is view-a, then I do the following tests:

Android back button only
  1. navigate to view-b
  2. navigate to view-c
  3. use the android back button - takes me to view-b
  4. navigate to view-c
  5. use the android back button - takes me to view-b
  6. use the android back button - takes me to view-a
Kendo back button only
  1. navigate to view-b
  2. navigate to view-c
  3. use the kendo back button - takes me to view-b
  4. navigate to view-c
  5. use the kendo back button - takes me to view-b
  6. use the kendo back button - takes me to view-a
Both the kendo and android back buttons
  1. navigate to view-b
  2. navigate to view-c
  3. use the kendo back button - takes me to view-b
  4. navigate to view-c
  5. use the kendo back button - takes me to view-b
  6. use the android back button - takes me to view-c
  7. use the android back button - takes me to view-b
  8. use the android back button - takes me to view-c
  9. use the android back button - takes me to view-b
  10. use the android back button - takes me to view-a
Notice the extra steps when using first the kendo back button and then the android back button? FYI, the same happens when using android first and then kendo. Ideally what would happen is the same behaviour as in the first 2 scenarios.

Why would I want both back buttons available you ask? Well I've implemented a swipe gesture that fires navigate("#:back") for convenience because reaching for the back button on a tablet can be a stretch.

So, any ideas? Is this something that would need to be fixed/developed in kendo mobile or is there something I can do?
Petyo
Telerik team
 answered on 14 Feb 2014
1 answer
117 views
Hello,

I have a Hierarchical Data Source and work fine for display in ListView.

I can also CRUD the root level without problem. However, I could not update the second level (node.children).

No mater tried node.children.sync(), or even the top <Hierarchical Data Source>.sync(), the update function of transport had not been triggered. 

I tried modify a child record: node.children.at(0).set('newKey', 'newValue'). node.children.hasChanges() retuned True. After node.children.sync(), node.children.hasChanges() retuned False. But Transport.update had not been triggered so that nothing was written into datasource.

Any idea?

Alex Gyoshev
Telerik team
 answered on 14 Feb 2014
2 answers
120 views
I am following the documentation here http://docs.telerik.com/kendo-ui/api/mobile/view#events-beforeShow
It suggests that if you want to redirect to another view while evaluating the application's state in the before show method, you should use the e.preventDefault() method.

I have put together a small test application using this strategy and when this pattern is followed the entire application stops working. No stack traces are thrown, no errors logged. The kendo application simply dies.

I am using kendo v2013.3.1324 with the bundled jQuery (v1.9.1)

To illicit the behavior with the attached application follow these steps:
1) Click on the view 2 link. This is the protected view so you should be directed back to view 1.
2) Click on the view 3 link. This is not a protected view so you should see view 3.
3) Click on the view 1 link. This is not a protected view so you should see view 1.
4) Click on the view 2 link again. The application stops with no warning. Links are dead, no interaction with the app can be performed.

I've attached an app that illustrates this behavior and included the code below:
<html>
    <head>
        <script src="scripts/kendo/jquery.min.js"></script>
        <script src="scripts/kendo/kendo.mobile.min.js"></script>
        <link href="styles/kendo.mobile.common.min.css" rel="stylesheet" type="text/css" />
        <link href="styles/kendo.mobile.all.min.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <div id="view1" data-role="view" style="background:grey;">
            <ul data-role="listview">
                <li>This is view 1</li>
                <li><a href="#view2" data-transition="fade">Go to view2 »</a></li>
                <li><a href="#view3" data-transition="fade">Go to view3 »</a></li>
            </ul>
        </div>
        <div id="view2" data-role="view" data-before-show="protect">
            <ul data-role="listview">
                <li>This is view 2</li>
                <li>You should never see this</li>
            </ul>
        </div>
        <div id="view3" data-role="view">
            <ul data-role="listview">
                <li>This is view 3</li>
                <li><a href="#view1">Go to view 1 »</a></li>
            </ul>
        </div>
        <script type="text/javascript">
            var app = new kendo.mobile.Application($(document.body), {
                skin: "flat",
                transition: "fade" 
            });
            function protect(e)
            {
                console.log("protect method");
                e.preventDefault();
                app.navigate("#view1");
            }
        </script>
    </body>
</html>

Petyo
Telerik team
 answered on 14 Feb 2014
1 answer
89 views
Hi,
This question is regarding something I'm trying to do in a grid, but it is a general question for templates in general.
I have a grid in which I have a template for a column like this:
template: '<span kendo-tooltip k-content="\'#=timeStamp#">#=timeStamp#</span>'
Is there a way to manipulate the timeStamp and add/subtract hours from it?
So for instance, my timeStamp is: 12/5/2013 08:37:56, and in the template it will add a constant to the time which will add a certain amount of time (i.e. 2 hours) so in the grid I'll see 12/5/2013 10:37:56
Alexander Valchev
Telerik team
 answered on 14 Feb 2014
2 answers
240 views
Hello,

I have an asynchrone function that generate a scrollView depending on the data I'm pulling from the server, I want to be able to display different buttons in the Scroll View.

So I am using an if statement in the scrollView template like so:


<div data-role="view" data-layout="overview-layout" data-show="showEvent" data-title="Meet My Friends" id="event">
            <div data-role="content" class="content">

                <div id="eventContent"></div>

                <div>
                    <div id="friendsToInvite" data-role="scrollview" data-source="friendsToInvite" data-template="friendsToInvite-template" data-enable-pager="false"></div>
                </div>
            </div>
        </div>


<script id="friendsToInvite-template" type="text/x-kendo-template">
            <p class="friendName">#= name #</p>
            <div style="width: auto; height: 180px; background: url('https://graph.facebook.com/#= fbId #/picture?type=large')  no-repeat center;"></div>

            #if( invited ) {#
                <p class="friendsButtons"><button class="button2 btn-green" onclick="uninviteFriend(this, #= fbId #, #= eventId #)">Already Invited : Un-invite</button></p>
            #} else {#
                <p class="friendsButtons"><button class="button2 btn-orange" onclick="inviteFriend(this, #= fbId #, #= eventId #)">Invite</button><button class="button2 btn-grey">Dont show me again</button></p>
            #}#
        </script>

And in my show function at some point I have

$.when( Event.getFriendsList( event.id ) ).done( function( friendsList )
    {
        console.log("when");
        if ( friendsList.length > 0 )
        {
            var friendsToInvite = [];

            for ( var i = 0; i < friendsList.length; i++ )
            {
                friendsToInvite.push( { name: friendsList[i]["name"], fbId: friendsList[i]["fbid"], invited: friendsList[i]["invited"], eventId: event.id } );
            };
            console.log( friendsToInvite );
            $( "#friendsToInvite" ).data( "kendoMobileScrollView" ).setDataSource( friendsToInvite );
        }
        else
        {
            console.log("Got to be creative here ...")
        }
    });

My problem is that I have a js error in my console saying that "Uncaught ReferenceError: invited is not defined " This is coming from the if statement.
How can I fix this ? In the doc, it seems that when having if statements in your kendo ui, you need to generate it at the init of the page.

Thanks



















Alexander Valchev
Telerik team
 answered on 14 Feb 2014
2 answers
6.0K+ views
How do you iterate over the results of an xml datasource. I can see the results if I bind a list to this datasource, but say for instance I want to insert a list with a different innerhtml string for a certain optTypeID from the datasource below. How would I achieve that in a function call named processInfo?

var dsDet
    dsDet = new kendo.data.DataSource({ 
              transport: {
                     read: "Details.xml"
                 },
                 schema: {
                     type: "xml",
                     data: "/Category/Field",
                     model: {
                         fields: {
                             name: "@Name",
                             displayName: "@DisplayName",
                             value: "@Value",
                             optTypeID: "@OptTypeID"
                         }
                     }
                  }
                 });  
               
function processInfo()
{  
Need a loop here to look through the results and if the optTypeID=1 for instance I want to insert 
<li> test1</li> into a div.
If optTypeID=2 then insert
<li> test2</li> into a div.
}    

Any help would be greatly appreciated.

Thanks
Rosen
Telerik team
 answered on 14 Feb 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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?