Telerik Forums
Kendo UI for jQuery Forum
2 answers
608 views
Hi,

 I have an editable grid showing data from DataSource and updating the backend with autosync. So far everything has gone quite smoothly and I'm generally pleased with Kendo grid filtering capabilities. I, however, have an issue with autosync. I want to disable some columns from autosync.

The simplified model of the grid is two columns, “word1” and “word2”. In addition to that, I will have several boolean columns that I use for filtering. I have several such boolean columns. Some of them are generated on the backend and some of them I want to modify on-the-fly in client.

One such filter is to flag rows that have the same value in columns “word1” and “word2”.

I have tested iterating over data and setting the boolean column. The current test code is as follows:

01.$("#test").click(function() {
02.    for (var i=0; i<DS.data().length; i++) {
03.        var row = DS.at(i);
04.        if(row.word1==row.word2) {
05.            console.log("Words are the same: "+row.word1+"=="+row.word2)
06.            row.set("ok", true);
07.        } else {
08.            console.log("Words are not the same: "+row.word1+"!="+row.word2)
09.            row.set("ok", false);
10.        }
11.    }
12.});
When I run the function, it updates the column as I want it to. But, here's the issue; it
sometimes generates a lot of traffic for the backend because many values in the boolean column might change. This is not wanted, since the boolean columns are only temporary for the user to get a glance at the data. Autosync should only track columns word1 and word2. The changes in other columns should go unnoticed by autosync.

Finally, my two questions:

1) Is there a way to define which fields are monitored by autosync?

2) Is there a way to define which fields are sent to backend after editing? I do not need the contents of temporary boolean columns on the backend, so when user changes, say, word1, I am only interested in getting values of word1 and word2, not the other columns.
ICT
Top achievements
Rank 1
 answered on 14 Jun 2013
2 answers
245 views
I've customized the look of the splitter a bit to match some UI mockups I am designing against. I've avoided margin/border/padding on k-pane elements at all costs. However, I am revisiting the issue and am wondering if anyone has any tips to correct the current problem I'm facing.

Currently, I draw the borders and apply margin to an element within the k-pane. The best I can make things look is this: http://i.imgur.com/LUvaJff.png 

I want the border outside the scrollbar. But I also want the scrollbar to be generated by the splitter and not defined by an element nested inside of it. Like this: http://i.imgur.com/PkpyfMe.png

Help/tips are appreciated.
Dimo
Telerik team
 answered on 14 Jun 2013
1 answer
149 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
110 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
106 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
87 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
168 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
111 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
637 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
102 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
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
Dialog
Chat
DateRangePicker
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
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?