Telerik Forums
Kendo UI for jQuery Forum
1 answer
143 views
I am attempting to load a file with ajax. Once the content is loaded, I want to impose the kendoComboBox() function to all items that are classed as "drop-list" 
Just with this code (I can supply more if necessary) are there any errors you see?
Below is the javascript that pull the .htm (below the first block of code)
Grid and Chart are able to activate.
The combo box doesn't, nor does date-range,
if ($(e.target).parent().hasClass('hb-hasView') ){
            hb.addTab({text:$(e.target).text(),content:'<br>'});
            var view = 'views/'+$(e.target).parent().attr('hb-view')+".htm";
             
            $.ajax({url: view})
            .success(function(html){
                $('#tabSet div:last-child').append(html);
                $('#tabSet div:last-child').children().each(function(){
                    var $this = $(this);
                    if ( is('drop-list') ){
                        $this.kendoComboBox();
                    }
                    if ( is('date-range') ){
                        $this.kendoDateTimePicker();
                    }
                    if ( is('grid') ){
                        $this.kendoGrid();
                    }
                    if ( is('chart') ){
                        $this.kendoChart();
                    }
                    function is(DOMclass){
                        return $this.hasClass(DOMclass);
                    }
                });
            });
        }
<form>
    <div>
        Start Time<input class="start date-range" value="10/10/2011" hb-for="*"/>
        End Time<input class="end date-range" value="10/10/2011" hb-for="*"/>
    </div>
    <div class="search-button"><input type="submit" value="Search" hb-for="*"/></div>
    <div class="search-button"><input type="submit" value="Reset" hb-for="*"/></div>
    <details id="aopt-title">
        <summary>Advanced Options</summary>
        <div id="advanced-options">
            <label class="ddl1">
                <div>Purchase Type:</div>
                <select id="test1234" class="drop-list" hb-for="*">
                    <option>************</option>
                    <option>************</option>
                    <option>************</option>
                </select>
            </label>
            <label class="ddl2 ">
                <div>Channel:</div>
                <select class="drop-list" hb-for="">
                    <option>************</option>
                    <option>************</option>
                    <option>************</option>
                </select>
            </label>
            <label class="ddl3">
                <div>Order Conf:</div>
                <select class="drop-list" hb-for="">
                    <option>************</option>
                    <option>************</option>
                    <option>************</option>
                </select>
            </label>
            <label class="ddl1">
                <div>Skills:</div>
                <select class="drop-list" hb-for="">
                    <option>************</option>
                    <option>************</option>
                    <option>************</option>
                </select>
            </label>
            <label class="ddl2">
                <div>Contact Center:</div>
                <select class="drop-list" hb-for="">
                    <option>************</option>
                    <option>************</option>
                    <option>************</option>
                </select>
            </label>
            <label class="ddl3">
                <div>Iconic/.com:</div>
                <select class="drop-list" hb-for="">
                    <option>************</option>
                    <option>************</option>
                    <option>************</option>
                </select>
            </label>
            <label class="ddl1">
                <div>Operator:</div>
                <select class="drop-list" hb-for="">
                    <option>************</option>
                    <option>************</option>
                    <option>************</option>
                </select>
            </label>
            <label class="ddl2">
                <div>Page Size:</div>
                <select class="drop-list" hb-for="">
                    <option>************</option>
                    <option>************</option>
                    <option>************</option>
                </select>
            </label>
            <label class="ddl4">
                <div>Survey Question:</div>
                <select class="drop-list" hb-for="">
                    <option>************************************************</option>
                    <option>************************************************</option>
                    <option>************************************************</option>
                </select>
            </label>
        </div>
    </details>
</form>
<div class="data-portion">
    <div id="grid" class="grid"></div>
    <div id="chart" class="chart"></div>
</div>
Alexander Valchev
Telerik team
 answered on 14 Jun 2013
1 answer
100 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
98 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
77 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
156 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
102 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
605 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
97 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
109 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
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)
SPA
Filter
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
OrgChart
TextBox
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
Popover
DockManager
FloatingActionButton
TaskBoard
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
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
TimePicker
DateTimePicker
RadialGauge
ArcGauge
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?