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

I have a grid with a field with a custom editor.  This editor consists of an input field, and I have applied validation to this using the HTML5 attributes (required, min, etc). The field uses data-bind syntax to get/set the data.

This works correctly and I get an error message when updating the field with invalid values.  
However there appears to be a big flaw to how this works, the data-binding occurs BEFORE the validation it would seem.

Even if I enter an invalid value. the change event still fires on the dataSource and the new invalid value is set.  
This seems to me to be unwanted behaviour, if there is an invalid value I do not want this set in the datasource.

Is this by design? How can I stop the data source updating on a validation failure?

Thanks in advance,
David Asbury.

ps.  It is also possible to bypass the validator simply by pressing the escape key.  This kills the validation message and removes focus from the invalid control.   This also seems like a bug. 
Rosen
Telerik team
 answered on 15 Nov 2013
1 answer
144 views
I have a datasource that I am trying to graph that looks like :

     @(Html.Kendo().Chart(Model)
        .Name("chart")
        .Title("Site Tag Values")
        .DataSource(dataSource => dataSource           
            .Group(group => group.Add(model => model.site))
            .Sort(sort => sort.Add(model => model.timeStamp).Ascending())
        )

How do I add a sub group to this Group setting? I want to add model.tag as the subgroup.  The online docs don't have the razor syntax for subgroups. 
Iliana Dyankova
Telerik team
 answered on 15 Nov 2013
1 answer
96 views
In my Treeview I have the below line of code.   That works fine and shows both AlphaId and BravoId in the markup that I can access.

branch.Add().Text(childs.SomeTitle).Id(childs.AlphaId.ToString()).HtmlAttributes(new { data_foo = childs.BravoId });
But then When setting a:
.TemplateId("treeview-template")


That looks like this:

<script id="treeview-template" type="text/kendo-ui-template">
    #: item.text #    
    # if (!item.items) { #
        <a href="/A/B/#=item.id#"><img src="@Url.Content("~/Content/Images/Image.png")" /></a>
    # } #
</script>



I can no longer access foo it is showing null.

Why are the id's no longer showing or accessable?
Daniel
Telerik team
 answered on 15 Nov 2013
1 answer
513 views
I am using the Kendo Grid with a custom sort criteria component, and also storing the grid state so as to return the grid to the state it was in when the page is reloaded at a later stage. In so doing, I need to set the grid to a specific page, and pass additional values to the read action.

 I do not know how to set the page number along with the additional data in one call, so I am setting the grid page and calling read on the dataSource to achieve what I want. Naturally, I would prefer to do this in one call. So, what I want to know is: Can you set the page on the grid without triggering a dataSource read?

I read about the autoSync property, and thought I could temporarily set it to false (while setting the page number), but the property does not seem to be there. Was it deprecated?

 And:
Can I set the read to be a JavaScript function, so as to pass additional values that way? I know I can call the read method from script, and I am, but I want to make the "default" read (the one triggered when paging) to be a javaScript function.

Edit:
I just found the example that illustrates passing additional data to the read action by calling a javaScript function. Nice! So please ignore the second question. So, the only issue I have left is how to get back data and jump to a specific page in one step (without resulting in two calls to the read action).

2nd edit: 
Sorry, I typed this in the early hours of the morning and was not very coherent. What I am looking to do can be distilled to the following: 

Is it possible to, on the initial load (page loading for the first time with a Kendo Grid), set the grid to start on a specific page (other than page 1)? 
What I have done is to add  a hidden element to the page with the page number I want to set the grid to as the value. Then, by binding to the databound event, I can check this value and, if it is required (if it is greater than 1), set the grid's page number to this value, which then triggers the read. This works, but it means two calls to the read action (the initial one, and the one for the page jump). I tried switching off the autoBind, but it still requires two calls to get the grid set. It seems that calling the read action with a page number greater than the current page set causes it to be ignored and revert to page 1. So, one has to load page 1, then jump to the page you want.

Is there any way to set the grid's initial page number, so as to avoid the double data read?

  

Patrick
Top achievements
Rank 2
 answered on 15 Nov 2013
3 answers
222 views
Is there a way to change the default 200ms fade:in modal view animation or disable it entirely? I tried manually setting the kendoMobileModalView's shim options but to no avail.
function btnShowModalView_Click(e) {
   var mv = $("#mvComposer").data("kendoMobileModalView");
   //look under the hood of kendoMobileModalView
   //console.log(mv);
   mv.shim.options.duration = 200;
   mv.shim.options.effect = "slide:up";
   mv.open();
}
Plamen Ratchev
Top achievements
Rank 1
 answered on 15 Nov 2013
1 answer
43 views
Hi,

It looks like there is some bad styling for the Kendo Window when used in iOS7.  Look at the title bar in the attached screenshot.  The window looks normal in iOS6.  I'm using kendo web v2013.2.918, kendo mobile v2013.2.918, kendo dataviz v2013.2.918 and PhoneGap 3.1.

Any help would be greatly appreciated.
Iliana Dyankova
Telerik team
 answered on 15 Nov 2013
1 answer
153 views
http://www.kendoui.com/forums/kendo-ui-web/grid/virtual-scrolling-for-hierarchy-grid-doesn-t-work-properly.aspx
As in the above link it is mentioned that vertical scroll is not supported with detail Template
Currently this bug is resolved or still it is unsupported
Dimo
Telerik team
 answered on 15 Nov 2013
1 answer
173 views
Hi,

I am modifying the Custom Template for the ScrollView.  I have it displaying 4 images per page just like the demo does but I have noticed that if the total number of images returned in the data set isn't divisible by 4 then the remaining images do not display.

For example, my data set has 101 entries. Images 1-100 are seen but image 101 doesn't show. I assume that this is because the template is expecting 4 records or images at a time.

How can I make sure that all my images display regardless if the total is divisible by 4 or not?


Thanks,
Eric
Alexander Valchev
Telerik team
 answered on 15 Nov 2013
1 answer
228 views
Hi, 
I am using a grid with inline editing.  I would like for the Add button in the tool bar to invoke an action (go to a full edit screen) instead of adding inline.  Is there a  way to override this? 
Thank you. 
Alexander Valchev
Telerik team
 answered on 15 Nov 2013
1 answer
95 views
Using this JSON...

{
    Name: "Top Level",
    Collection: [
        First: [
          {
            Name: "Child",
            Size: 8,
            onIncrease: function(e){
                var current = e.data.get("Size");
                e.data.set("Size", current += 1);
            }
          }
        ]
    ]
}

With this template
<div data-template="tmpl-boxes-for-size" data-bind="source: Collection.First"></div>
<script type="text/html" id="tmpl-boxes-for-size">
    <div class="k-rails">
        <div class="k-item-reduce"></div>
        # for(var index = 0; index < data.Size; index++ ) { #
            <div class="k-rails-item"
                 style="text-align: center;
                        font-size: 20px;
                        vertical-align: middle;">
                #= index + 1 #
            </div>
        # } #
        <div class="k-item-increase" data-bind="click: onIncrease"></div>
    </div>
</script>


The DOM will not update when the code runs and increases the size, without an explicit call to the change event.

I am including the CSS classes used too, just for your convenience.
.k-item-reduce {
    float: left;
    width: 0px;
    height: 0px;
    border-top: 16px solid transparent;
    border-bottom: 16px solid transparent;
    border-right: 8px solid #ccc;
}
.k-item-increase {
    float: left;
    width: 0;
    height: 0;
    border-top: 16px solid transparent;
    border-bottom: 16px solid transparent;
     
    border-left: 8px solid #ccc;
}
 
.k-rails {
    position: relative;
 
    &:after {
        clear: both;
    }
 
    .k-rails-item {
        float: left;
        display: block;
        margin: 2px;
        height: 24px;
        width: 24px;
        border: dashed 1px #ccc;
    }
}
Running it with the following code will get it to work, but it is a bit obtuse. I would prefer if it just worked like other updates.
{
    Name: "Top Level",
    Collection: [
        First: [
          {
            Name: "Child",
            Size: 8,
            onIncrease: function(e){
                var current = e.data.get("Size");
                e.data.set("Size", current += 1);
                viewModel.trigger("change", { field: "Collection" });
            }
          }
        ]
    ]
}


Petyo
Telerik team
 answered on 15 Nov 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?