Telerik Forums
Kendo UI for jQuery Forum
1 answer
180 views

I'm using Kendo MVVM.

I have a function on my viewModel which is determined in the show event.
So in the data-show I perform a
viewModel.set("clickFunction", clickFunction);

Then I try to bind in the view using:
<a data-bind="click: clickFunction">Click Me</a>
I have tried every way of binding the click event to the <a tag with no success.

The problem I am trying to solve is on the mobile device I need to navigate between several SPAs (Don't argue with me that it shouldn't be done this way, I have requirements which make this valid). So when trying to navigate between SPAs I have to use functionality provided by Cordova
changePage: function(url){
            window.location = url;
        }
However the url need to be built and have url parameters determined in a view show event.

If there is a better way of doing this in a listview <a styled element I am open to them.
Travis
Top achievements
Rank 1
 answered on 02 May 2013
2 answers
38 views
I have a kendo editor inside a modal jqueryui dialog. This editor uses the image browser. In IE8 the Upload button in the image browser doesn't work.

Perhaps it is an issue with z-index of the file upload element being lower than the z-index of the jqueryui dialog overlay.

Example code attached. Run it, click TEST, click the image browser button, click Upload. Nothing happens in IE8. This only occurs in real IE8, not IE8 emulated mode inside IE9 or 10.

I tried both the newest stable release and the newest beta of the editor - no difference.
Gregg Faus
Top achievements
Rank 1
 answered on 01 May 2013
6 answers
317 views
I don't fully understand why this is happening but it appears to be a bug.  Pardon not having full source code, I don't have time to extract the useful parts into a jsfiddle at the moment.

Essentially I have MVVM binding to a remote data source.

<input type="text" id="jobName" data-bind="value: data.Name" class="k-input validate" required />
 
var validatable = $("#windowUpdateJob").find("#jobName").kendoValidator().data("kendoValidator");

When I initialize the validator, it seems to break the jobName object.  Various things cause the following error:

kendo.all.js ~line # 7130 - this.widget.value is not a function

Without the validator it works ok.

I also found that if I just add a data-role to the <input> it also fixes the issue.  i.e.

<input type="text" data-role="NumericTextBox" id="jobName" data-bind="value: data.Name" class="k-input validate" required />


Maybe I'm doing something funky somewhere else in the code that's causing this?  I don't have a problem adding a data-role to all MVVM objects, but in this case jobName is not numeric - that's just the quickest thing I found that worked.
Zachary
Top achievements
Rank 1
 answered on 01 May 2013
2 answers
154 views
Hi,

I am using mvc kendo ui grid:
                    @(Html.Kendo().Grid<PortalUser>(Model.GetUsers())
                    .Name("Grid")
                    .Columns(columns =>
                    {
                        columns.Bound(p => p.ID).Width(200);                    
                        columns.Bound(p => p.UserName).Width(250);
                        columns.Bound(p => p.Password).Visible(false);
                        columns.Bound(p => p.Email).Width(250);
                        columns.Bound(p => p.Role.Name).Width(200).Title("Role");
                        columns.Bound(p => p.Comment).Width(300);
                        columns.Bound(p => p.IsLockedOut).Title("Locked").Width(100);
                        columns.Command(command => { command.Edit(); }).Width(100);
                        columns.Command(command => { command.Destroy(); }).Width(100);

                    })
                     .ToolBar(toolbar => toolbar.Create())
                     .Editable(editable => editable.Mode(GridEditMode.PopUp))
                    .Pageable()
                    .Sortable()
                    .Scrollable()
                    .Filterable()
                    .Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
                        .DataSource(dataSource => dataSource
                            .Ajax()
                            .Batch(false)
                            .ServerOperation(false)
                             .PageSize(50)
                             .Create(update => update.Action("Users_Create", "Membership"))
                            .Read(read => read.Action("Users_Read", "Membership").Data("FilterUsers"))
                            .Destroy(update => update.Action("Users_Delete", "Membership"))
                            .Update(update => update.Action("Users_Edit", "Membership"))
                            .Model(model =>
                                {
                                    model.Id(m => m.ID);
                                    model.Field(m => m.ID).DefaultValue(new Guid());
                                    model.Field(m => m.Role).DefaultValue(new PortalRole { RoleID = Guid.NewGuid(), Name = "no role" });
                                })
                        )
                        .HtmlAttributes(new { style = "height:500px" })
                )

I want the Role field to display as dropdown in the popup editor. So i have created a template file called RoleEditor.cshtml in Views\Shared\EditorTemplates.

I have also added the decoration attribute 
        [UIHint("RoleEditor")]
        public PortalRole Role { get; set; }
to the model class
I have followed all the steps given in your documentation:
http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/editor-template
and yet it does not work.



Dilip
Top achievements
Rank 1
 answered on 01 May 2013
2 answers
46 views
Hi, 

I am defining some columns for a kendogrid
            sortable: true,
            columnMenu: true,
            resizable: true,
            scrollable: false,
            columns: [
                { field: 'Owner', title: 'Owner' },
                { title: 'W-M', template: '#= WeightCarried # | #= Medication # '},
            ]

Why does the Owner column have a columnMenu, is resizable, and sortable, but the other column cannot do any of these?

Is this a limitation when using a template? Or am I simply missing some additional option?
Jordon
Top achievements
Rank 1
 answered on 01 May 2013
3 answers
88 views
I've had a very difficult time trying to get FX transfer (http://docs.kendoui.com/api/framework/fx/transfer) to simply move a div from one position to another.  It seems like to would be very straightforward.  However, it wasn't.  I tried to work backwards from the transfer demo (http://demos.kendoui.com/web/fx/transfer.html) and finally, after much trial and error, I was able to accomplish it (sort of).  

Please see this jsfiddle .  The trick to get it to work was to make the height/width of #Finish 1px less than #Start. However, I don't want to have to change the height/width.  I just want the div to move (I also discovered that I could get it to work with height/width of 110px if I added a border.  However, I don't want a border).  So, my question is, is this a bug?  Shouldn't I be able to use transfer to move a div without changing the height/width or adding a border?  If there is a way, please let me know.



Petyo
Telerik team
 answered on 01 May 2013
1 answer
172 views
I am having some issues with styling an element inside an li.  I am trying to use a flexbox to render some content horizontally, and when I view it in the simulator in icenium it works great, however on the actual devices (both android and iOS) the rendering is different.  You can see the code in this jsfiddle.  I know that the devices are using the old flexbox syntax, I can make it look right when the content is outside of an li of a listview, but not inside.

On the actual device the flex elements are rendering vertically instead of horizontally, I have attached an image for illustration purposes on how it looks on a real device.

Is there something about the listview that I need to modify to get this to work correctly? Or am I just better off not using  flexbox? (in the example here I have a simple layout without many elements but I am  planning on making it more complex and a flexbox would really be nice for implementing it).


David
Top achievements
Rank 1
 answered on 01 May 2013
1 answer
57 views
What is wrong with this code??

columns.Bound(o => o.Resolved).
ClientTemplate("# if (Resolved == true) { # <input type='checkbox' checked='checked' /> # } #")

This displays nothing in the column. All values are true for Resolved.
Dimo
Telerik team
 answered on 01 May 2013
4 answers
161 views
Hi I'm trying to set my bulletgraph up to use a remote data source however I'm not currently seeing anything on the graph. The JSON output is this:

{"backlogtotalcount":1970}

I get that by running this ajax function in firebug:

$.ajax({
type: 'GET',
url: $('#operationalBacklogGaugeValue').data('url'),
success: function (data) {
$('#operationalBacklogGaugeValue').val(data);
}
});

Finally my bullet graph chart is here:

function operationalEfficiencyChartLoad() {
    setTimeout(function () {
        createOperationalEfficiencyChart();
        $('#operationalEfficiencyChart').bind("kendo:skinChange", function (e) {
            createOperationalEfficiencyChart();
        });
    }, 200);
}

function createOperationalEfficiencyChart() {
    $("#operationalEfficiencyChart").kendoChart({
        legend: {
            visible: false
        },
        dataSource: {
            transport: {
                read: {
                    url: $('#operationalEfficiencyChart').data('url'),
                    dataType: "json"
                }
            }
        },
        series: [{
            type: "bullet",
            currentField: "backlogtotalcount",
            color: '#838281',
            target: {
                line: {
                    width: 0
                 }
            }
        }],
        chartArea: {
            height: 75,
            width: 805,
            margin: {
                left: 0
            }
        },
        categoryAxis: {
            majorGridLines: {
                visible: false
            },
            majorTicks: {
                visible: false
            }
        },
        valueAxis: [{
            plotBands: [{
                from: 0, to: 1960, color: "#8FD400", opacity: .4
            }, {
                from: 1960, to: 2300, color: "#FFD100", opacity: .5
            }, {
                from: 2300, to: 3000, color: "#FF5B35", opacity: .6
            }, {
                from: 1956, to: 1956, color: "#000000", opacity: 1
            }],
            majorGridLines: {
                visible: false
            },
            min: 0,
            max: 3000,
            minorTicks: {
                visible: true
            }
        }],
        tooltip: {
            visible: true,
            format: "#.##"
        }
    });
}

I'm trying to setup a fiddle here http://jsfiddle.net/Alex_Hagerman/bsGTk/16/, so there may be a live demo if that would help but it currently is not co-operating.

If you can tell me what is wrong with this remote data source setup I would really appreciate it.

Alexander
Top achievements
Rank 1
 answered on 01 May 2013
2 answers
77 views
I have the following VM:

var ExportVM = kendo.observable({
    ticketID: "bad",
    maxTiles: 15,
    jobTime: "not yet set",
    timeEstimate: "really bad",
    tileRate: 0,
    tileCount: 0
});
Which I am binding at the top a large DOM, which deep inside has the following two spans that are being data bound:

<div id="ExportBeginBlock">
    <div class="SectionBlock">
        <span>Estimated Time:</span>
        <span data-bind="text: jobTime"></span>
        <span>Hours:Minutes:Seconds</span>
    </div>
    <div class="SectionBlock">
        <span>Estimated Tile Files:</span>
        <span data-bind="text: maxTiles"></span>
    </div>
    <div id="buildMapPackageButton" class="k-button button green bigrounded">BUILD MAP PACKAGE</div>
    <div id="cancelMapButton" class="button rosy bigrounded k-button">CANCEL</div>
</div>
Every once and a while a message comes in from the server and I update the VM:

01.function ShowEstimates(data)
02.{
03.    ExportVM.set("maxTiles", data.maxTiles);
04.    ExportVM.set("ticketID", data.ticket);
05.    ExportVM.set("jobTime", data.timeEstimate);
06.    ExportVM.set("timeEstimate", data.timeEstimate);
07.    ExportVM.set("tileRate", data.tileRate);
08.    kendo.bind($("#ExportBlock"), ExportVM);
09.}

Ok, this works fine, as long as the line #8, iwhich does the rebind is in. But if I move the binding out of the update loop, and do it once at the beginning of the code, then this is not getting rebound! I thought the whole idea of MVVM was that you can just update the VM values. What am I missing.

I have looked in firebug, and I see that the VM is being updated, but I don't see the DOM changing unless I force it.

I am a noobie at MVVM so I assume I am doing something dumb.

Dr.YSG
Top achievements
Rank 2
 answered on 01 May 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?