Telerik Forums
Kendo UI for jQuery Forum
1 answer
57 views
I'd like to extend the Mobile View to callback a custom event. Ideally, I'd like the be able to write something in HTML like:

<div data-role = "view" data-init="myView.init" data-logout="myView.logout" />

How would I go about implementing something like this?
Kiril Nikolov
Telerik team
 answered on 02 Feb 2015
1 answer
50 views
Hi there;

I've enabled data-zoom on a couple of views in our app to support pinch to zoom.  However now it seems users can no longer swipe to show the navigation drawer?  Is this a bug or by design, or do I just have something configured incorrectly?

Thanks,
Jason
Kiril Nikolov
Telerik team
 answered on 24 Jan 2015
6 answers
87 views
Would there be any performance advantage to creating views in the same file as opposed to several different htmls?
I'd like to split them up into their own files in order to clean up my project a little bit, but I'm not sure if it would slow things down or if it's purely for organization.

Thanks!
Petyo
Telerik team
 answered on 20 Jan 2015
5 answers
52 views
Hi
  Apologies in advance as I suspect this is probably obvious, just not to me

Can you make the back button or href navigation (data-role="backbutton") miss out pages?

I have a collection of views

A->B->C1->D1
              |      |
            C2->D2

Here the user may go from View A to B, if they hit back they'll go back to A. Fine

They may go A->B->C1->C2->C1->C2, if they hit back they'll go back through the sequence again but I'd like them to go back to B, i.e. bypassing the C1->C2->C1 sequence, almost as though C1 and C2 were the same page

I can't go directly to B from C2 as they may not have come to C2 from B, they may have come from somewhere else

So Ideally there would be something which would let you navigate between to C2 and C1 without going into the history

I'm guessing you can do something in raw javascript with the history object to do this but I'm wondering what the 'kendo' way to do this is

thanks




Anthony
Top achievements
Rank 1
 answered on 19 Jan 2015
2 answers
53 views
KendoUI version v2014.2.926 

I am trying to modify an html element after a view is shown.

So, I do this:

var view = new kendo.View(
    templateId, {
        model: viewModel,
        show: function() {
            handleRenderDone();
         }
     }
 );



In my handleRenderDone function, I can tell that the html has not been rendered yet. Do I misunderstand what the show event is for as described in the doc here: http://docs.telerik.com/kendo-ui/api/javascript/view#events-show

Thanks


Ryan
Top achievements
Rank 1
 answered on 03 Dec 2014
7 answers
107 views
Hi,

I have the following issue: We're creating a simple Employee Lookup app where you can drill down from the employee details to the manager details and direct reports details. Each of these pages essentially look the same so I would like to use the same view.

Here my issue:
- When I am on a view 'employee-detail-view' and then want to navigate to the same view again (for manager or direct reports), KendoUI doesn't do this because it keeps track of which view it is currently on.
- I also tried inserting dynamic views into the DOM based on user navigation but it seems KendoUI can't find them. It appears it finds all the local views at beginning of app creation and then doesn't find the dynamically created ones. The code below shows a 'failed to locate resource' error since KendoUI is looking for an external html file.
 
Can anyone point me to the right approach?

Thanks!

m.navigateEmployeeDetailView = function(empId) {
    // Forward Navigation
    m.navFlag = true;
    
    // Set Employee GUID
    m.selectedEmployeeId = empId;
    
    m.currentViewId = new Date().getTime();
    var viewId = "m-emp-detail-view-"+m.currentViewId;
    console.log('view id: '+viewId);
    var newViewDiv = '<div id="'+viewId+'" data-role="view" data-title="Details" data-before-show="m.showEmployeeDetailView" style="display:none;"></div>';
    
    // Add it to the container
    $('#m-emp-detail-views').append(newViewDiv);
    
    // Add Template
    var template = kendo.template($("#m-emp-detail-templ").html());
    var data = { empId: m.currentViewId }; 
    // Pass data to the template
    var result = template(data);
    $('#'+viewId).html(result);
    
    // Navigate to view
    m.kendoApp.navigate(viewId);
Kiril Nikolov
Telerik team
 answered on 11 Nov 2014
3 answers
215 views
I can't figure out why if you have a hyperlink to a remote view as a drawer item, it will correctly render the remote view within the Index.html page and have all the copied elements from the layout...i.e. the header and script references, etc.

See link in drawer item below: "views/business.html?businessId=3".

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="utf-8" />
    <link href="kendo/styles/kendo.mobile.all.min.css" rel="stylesheet" />
    <link href="styles/main.css" rel="stylesheet" />
 
    <script src="cordova.js"></script>
    <script src="kendo/js/jquery.min.js"></script>
    <script src="kendo/js/kendo.mobile.min.js"></script>
    <script src="scripts/app.js"></script>
 
</head>
<body id="body">
  
  <div data-role="layout" data-id="main">
    <div data-role="header">
      <div data-role="navbar">
        <span data-role="view-title"></span>
        <a data-role="button" href="#appDrawer" data-rel="drawer" data-align="left" data-icon="drawer-button"></a>
      </div>
    </div>
 
    <!-- application views will be rendered here -->
     
  </div>
 
  <!-- application drawer and contents -->
  <div data-role="drawer" id="appDrawer" style="width: 200px" data-title="Navigation" data-position="left" data-swipe-to-open="false">
    <div data-role="header">
      <div data-role="navbar">
        <span data-role="view-title"></span>
      </div>
    </div>
    <ul data-role="listview">
      <li>
        <a href="views/home.html" data-icon="home">Home</a>
      </li>
      <li>
        <a href="views/map.html">Map</a>
      </li>
      <li>
        <a href="views/settings.html" data-icon="settings">Settings</a>
      </li>
      <li>
        <a href="views/contacts.html" data-icon="contacts">Contacts</a>
      </li>
        <li>
        <a href="views/business.html?businessId=3" data-icon="contacts">Business Test</a>
      </li>
    </ul>
  </div>      
 
</body>
</html>

But, if I put his same hyperlink in another view, it will navigate to that view, but it will NOT copy all the layout elements like the head section with the script references. I just get the html elements of the remote view....
<html><head></head><body><div id="businessDetail" data-role="view" data-title="Business Details" data-layout="main" data-model="APP.models.business" data-init="initBusinessDetails">
    <!--<label for="Name">Name:</label><input id="name" data-bind="value: data.name" />-->
    <img style="float:left;width:50px;margin-right:5px;" data-bind="attr: { src: data.image_url }">
    <div style="float:left;display:inline-block;">
        <span data-bind="text: data.name"></span><br>
        <span data-bind="text: data.address1"></span><br>
        <span data-bind="text: data.city"></span>, <span data-bind="text: data.postal_code"></span>
    </div>
</div>
</body></html>
Petyo
Telerik team
 answered on 10 Sep 2014
1 answer
196 views
Hello,

This is my view:
<div id="viewemail" data-role="view" data-title="Email" data-layout="main" data-show = "email_loaded">
  <div id="email-subject"></div>
  <div id="email-body"></div>
</div>

This is how I open the view:
<a data-role="button" href="#viewemail?emailId=5" ><div class="row" id="5">Random Subject</div></a>

The function called on data-show:
function email_loaded(e) {
    id = e.view.params.emailId;
    $('#email-subject').text('Subject with id:'+id);
}

If the first block of code (the view) is inside my index.html file - it works.
If I move the view to a separate html file (views/email.html) it throws the following error:

How can I make it work when the view is in a separate file?
Kiril Nikolov
Telerik team
 answered on 04 Sep 2014
1 answer
171 views
How do you dynamically load a view and layout?  I can get the view to work by itself, but not a view with layout.  I created the simple example below to illustrate the issue.  The only way I can make this work is to place the layout in the index.html file, which means it's not dynamically loaded at runtime.

// insert view
$('body').append("<div data-role='view' id='view2' data-layout='main'>This is view2</div>")

// insert layout
$('body').append("<div data-role='layout' data-id='main'><header data-role='header'>Header</header><!-- application views will be rendered here --><footer data-role='footer'>Footer</footer></div>");

// display view
app.navigate('#view2');
Petyo
Telerik team
 answered on 27 Aug 2014
2 answers
78 views
I notice if I try to touch and hold on text in a Kendo mobile view the copy and paste features don't come up, at least on Android.  Is there a reason for this?

Scott
RES
Top achievements
Rank 1
 answered on 25 Aug 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?