Telerik Forums
Kendo UI for jQuery Forum
1 answer
97 views
I am looking for  a good script loader solution?

I have used the Kendo in web parts and I want to optimize the script loading when there is more than one web part on a page, any code sample would be appreciated
Thank you
Orna
Petur Subev
Telerik team
 answered on 14 Jun 2013
1 answer
94 views
[All sorted, it's a silly typo of the templateName....]

Hi support,

I'd like to implement the pull-to-refresh so that data from my ajax call are appended to the listview.

Please note I'm not using the datasource binding as it somehow adds an auto generated li element that screws my layout. I'll report the issue some other time.

Using my following code, I'm able to append data to the listview, however, the pull refresh seems only works when a datasource object is defined. 

I'd like to ask if there's any work around to get the pull to refresh working.

I have the following simplified scenario:

This is my ul element:

<div data-role="view" id="tabstrip-search" data-title="Search" data-layout="mobile-tabstrip" data-init="pullUpdate">
    <ul id="users-list" data-role="listview" >
    </ul>
</div>

This is my template: (tested working)
<script type="text/x-kendo-template" id="cardSearchTemplate">
#for (var i=0; i<CardSearches.length; i++){#
<li>
<h2>#=CardSearches[i].FirstName+' '+CardSearches[i].LastName#</h2>
<img src=#=CardSearches[i].PhotoUrl#></img>
<div id="arrow_frame"><img src="images/background/arrow.png"></img></div>
</li>
#}#
</script>

My ajax on success: (MyAjaxCall)
var template = kendo.template($("#"+templateName).html());
var result = template(data);
$("#users-list").append(result); //Append the result


Pull Function:
function pullUpdate(e)
{
var scroller = e.view.scroller;

scroller.setOptions({
pullToRefresh: true,
pull: function() {
MyAjaxCall();
setTimeout(function() { scroller.pullHandled(); }, 400);
}
}

The problem: Uncaught TypeError: Cannot call method 'replace' of undefined
I guess it is because I didn't use the datasource way to bind the data to listview and kendo ui trying to find a template but failed.

"MyAjaxCall" works fine if triggering it from a button, it correctly append data to the list view.  All I need is to call that function when user doing a  pull gesture to the listview.

Thanks for your time!

Regards,
Johnson
Alexander Valchev
Telerik team
 answered on 14 Jun 2013
5 answers
74 views
In the attached image you can see an issue we have with multiple charts in the same page. 

Each bar in this image is a stand alone chart, and the first time we get into the view, one of them is distorted. When we get into the page in subsequent entries, it looks OK (if we use a back button and revisit the page, for example).

Any ideas?
T. Tsonev
Telerik team
 answered on 14 Jun 2013
3 answers
153 views
I'm using MVC4 with KendoUI 2012.3.1114
I have a model like this...
class Contact {
    Phone WorkPhone {get;set;}
    Phone HomePhone {get;set;}
}
 
class Phone {
    string PhoneNumber {get;set;}
    bool IsPrimary {get;set;}
}
The contact view is using an editor template to display the phones:
@Html.EditorFor(m=>m.WorkPhone)
@Html.EditorFor(m=>m.HomePhone)
and in the Phone editor template, I have a checkbox...
@Html.TextBoxFor(m => m.PhoneNumber)
@Html.CheckBoxFor(m => m.IsPrimary)
everything works fine... until I add a kendo validator...
$("#formId).kendoValidator().data("kendoValidator");
Now when I check/uncheck the checkbox and click away (to trigger blur), I get a js error:

Webpage error details

Message: Syntax error, unrecognized expression: input:hidden[name=WorkPhone.IsPrimary]
Line: 2
Char: 59140
Code: 0
URI: .../Scripts/kendo/2012.3.1114/jquery.min.js

Is there fix for this?

Rosen
Telerik team
 answered on 14 Jun 2013
1 answer
100 views
hi guys
i built an app using icenium and kendo mobile. 
one of the views is responsible to upload selected files and upload them to my server.
to do that i use kendo web upload element. in icenium simulator every thing work fine but on my phone, after i select the file, the app behave like it restarting it self and it goes back to square one..
any ideas why?
regards maor
Petyo
Telerik team
 answered on 14 Jun 2013
6 answers
596 views
Hi all

I was looking for a best practice to handle Load/Unload Content and removing widgets.

For example.

1. User clicks a button, an existing tabStrip is Extended by a new tab
2. In the new tab Content gets loaded via an Ajax request
3. The new Content contains an html form with autocomplete, datepicker, Editor elements.
4. The user fills out the form, clicks a button to send serialized form to remote Server via Ajax
5. On success, remove the tab from tabstrip and all widgets that have been initialized on the fly bevor

So until Point 4 its clear to me how to make it. But what is the best way, to remove the new Content and all the widgets, so nothing is left in the Memory?

Thanks for advice.

Duke
Daniel
Telerik team
 answered on 13 Jun 2013
1 answer
91 views
I'm trying to display an image on the page, I'm using javascript to write out the image tag with the source pulled from the data source. When debugging, the value that is being passed is:

<img align='Left' style='width:100px;' alt='sample alt text.' src='http://www.website.com/IMAGE-05185619.jpg>.

But what is in the page is:

&lt;img align='Left' style='width:100px;' alt='sample alt text.' src='http://www.website.com/IMAGE-05185619.jpg&gt;

So when viewing the page, I see the img tag instead of the image.

My code:

<span data-bind="text: myImgFunc"></span>

var model = JSON.parse($('#cg-jsonall').text());
 var viewModel = kendo.observable({
    model: model,
     myImgFunc: function() {
        if (this.get('model.org.org_logo'))
  {
    var img = "<img align='Left' style='width:100px;' alt='" + this.get('model.org.name') + ".' src='http://reach.hillel.org/cache/upload/" + this.get('model.university.univ_picture') + ">";
   
    return img;
  }};
kendo.bind($("span"), viewModel);

Any suggestions?

Thanks.
Elizabeth
Top achievements
Rank 1
 answered on 13 Jun 2013
3 answers
1.2K+ views
Hi Kendo  team,

Scenario:
Let's say I am building a chart (bar, column etc.). The data comes from a datasource and the datasource has grouping applied to it. How can I map series color to a group value. For example, datasource can be something like:
year: 2000, agegroup: group_a, pop: 1000
year: 2000, agegroup: group_b, pop: 1200
year: 2001, agegroup: group_a, pop: 1001
year: 2001, agegroup: group_b, pop: 1201
year: 2002, agegroup: group_a, pop: 1002
year: 2002, agegroup: group_b, pop: 1202

Say I group by 'year' and 'agegroup'. I want to apply series colors mapped to the groups. Also, the groups can be dynamic meaning, I can have group_c, group_d and so on in there returned by the server-side. I also have colors corresponding to a group value already there in the database, meaning group_a - red, group_b - green etc.

Hope I was able to provide sufficient details above.

Thanks,
Amrinder

Iliana Dyankova
Telerik team
 answered on 13 Jun 2013
0 answers
107 views
Hello,

I'm unsure why but the side Pane within a SplitView, containing a view, is only calling it's data-show function once. It is not being called upon navigation to the view a second time. I've stripped the following code down to keep it simple.
<div data-role="splitview" id="events-split-view">
  <div data-role="pane">
    <div data-role="view" data-show="testDataShow">
      Side Pane
    </div>
  </div>
 
  <div data-role="pane" data-layout="main-default">
    <div data-role="view">
      Main Pane
    </div>
        
    <div data-role="layout" data-id="main-default">
      <div data-role="header">
        <div data-role="navbar">
          <a data-role="button" href="#contact-details-view" data-align="right" data-target="_top">Go back</a>
        </div>
      </div>
    </div>
  </div>
</div>
 
<script>                      
    function testDataShow() {
        alert("View's data-show called");
    }
</script>
Solution
The data-show needs to reside on the data-role="splitview" element rather than the view itself.


David
Top achievements
Rank 1
 asked on 13 Jun 2013
7 answers
247 views
I have created an online CodePen Demo: http://codepen.io/DrYSG/pen/wnDxL where I have a Grid bound to a KendoObservable 1-D array. The Array is meant to be (Item, Value) pairs. There are a number of clumsy things here that I would like to clean up.

1. I would love it if you supported Grid's that had Vertical Orientation, so that I could just have display 1-D array, and use the Column Headings for each item: see: http://www.kendoui.com/forums/ui/general-discussions/vertical-grid-property-grid.aspx
2. Doing the lookup for the value and changing it involves hard constants (stateTable[1].Value = foo. Do I have to have a use an index table that translates integers to keys. I.e. var StatusKey = 0, TileCountKey = 1, etc.  (then it would be stateTable[TileCountKey] = 2) Still seems clumsy.
3. This would be especially fragile, if the user could add and delete rows. (batch editing).
4. The KendoObservable.set() is not working for this example. So I am doing a manual trigger, which I saw in a post by Alexander Valchev, but I don't see documentation for trigger() anywhere., is this a hidden (unsupported feature?) This also feels a bit clumsy.
Why is there a scroll bar on my Grid?

Bottom line. It works now, but I want to know if there is something in KendoUI today, that would make this cleaner, and if not, do you have anything in UserVoice planned to fix this up?

Dr.YSG
Top achievements
Rank 2
 answered on 13 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?