Telerik Forums
Kendo UI for jQuery Forum
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
6 answers
237 views

I have a kendo grid that has a custom editor template for a field.  I want to be able to key the data into the cell as a string (default inline editing) or be able to click a 'loookup/search' icon in the cell, open a popup and make a selection and then populate the data into the cell I am working in.  I have all of it working except I can't seem to figure out how to make the callback that receives the data from the popup locate and update the cell that the popup was initiated from.  Here is a snippet of the code I'm using, what do I do in the callbackHandler?

       var columns = [
            {
                field: "Seq",
                title: "Line",
            },
            {
                field: "Name",
                title: "Name",
            },
            {
                field: "Model",
                title: "Model",
                editor: function (container, options) {
                    var input = $("<input />");
                    input.attr("name", options.field);
                    input.attr("class", "k-textbox");
                    input.appendTo(container);
                    var lookupLink = $("<img src=\"/content/images/search24x24.png\" onclick=\"showModelSearch(callBackHandler);\" />");
                    lookupLink.appendTo(container);
                }
            }
 
        myGrid = $("#myGrid").kendoGrid({
            scrollable: false,
            sortable: true,
            resizable: true,
            reorderable: false,
            dataSource: gridDataSource,
            columns: columns,
            toolbar: ["create"],
            editable: "inline",
        });
 
var callBackHandler = function(selectedData) {
    //Do what???
     //Update the cell that the popup came from with the data sent back
     //but how?
}

 

Dilip
Top achievements
Rank 1
 answered on 01 May 2013
5 answers
160 views
Hi,

I've problem with the latest (v2013.1.319) version of treeView.
When I add node using API it is added correctly ... but when I collapse it I cannot expand it again.
This problem occurs also on your demo site:
http://demos.kendoui.com/web/treeview/api.html
when you press "Append Node" and try the steps that I've just described.
Thanks,

Bart.
Alex Gyoshev
Telerik team
 answered on 01 May 2013
1 answer
171 views
Hi,

I have added controls in kenod panelbar. All controls in panelbar are inside form tag. When i click on submit button, all data is posted back.
But jquery.validate is not working for panelbar. I have initialized validation for controls in panelbar. But when I click submit button, validation is done for controls in panels which are expanded. Validation is not done for fields in panels which are collapsed. I guess, this is because collapsed panel has style as display:none
But is there any way,  jquery validate can work for this scenario?

Thanks in advance.
Petyo
Telerik team
 answered on 01 May 2013
1 answer
40 views
Hello,

Im trying to create a custome filter but this never pass to my controller some field that have the filter name

I create a function that initialize the Grid
function KendoUIGrid(config)
{
    var grid = $("#" + config.id);
 
    grid.kendoGrid({
        columns: config.columns,
        dataSource: {
            transport: {
                read: {
                    url: config.url,
                    dataType: "JSON",
                    type: "POST",
                    data: {
                        action: 'read'
                    }
                },
                //destroy: {
                //    url: config.url,
                //    dataType: "JSON",
                //    type: "POST",
                //    data: {
                //        action: 'destroy'
                //    }
                //},
                //update: {
                //    url: config.url,
                //    dataType: "JSON",
                //    type: "POST",
                //    data: {
                //        action: 'update'
                //    }
                //},
                //create: {
                //    url: config.url,
                //    dataType: "JSON",
                //    type: "POST",
                //    data: {
                //        action: 'create'
                //    }
                //},
                parameterMap: function (options) {
                    var result = {
                        page: options.page,
                        pageSize: options.pageSize,
                        skip: options.skip,
                        orderBy: '',
                        take: options.take,
                        pi: options.page == 1 ? 1 : options.skip + 1,
                        pf: options.skip + options.take,
                        action: options.action
                    };
 
                    if (options.sort != undefined) {
                        if (options.sort[0] != undefined) {
                            result.orderBy = options.sort != undefined ? options.sort[0]['field'] + ' ' + options.sort[0]['dir'] : '';
                        } else {
                            result.orderBy = 1;
                        }
                    }
 
                    return result;
                }
            },
            schema: {
                total: "total",
                data: "data"
            },
            pageSize: 15,
            serverSorting: true,
            serverPaging: true,
            severFiltering: true
        },
        sortable: true,
        resizable: true,
        pageable: {
            numeric: false,
            input: true
        },
        selectable: true
    });
Its ok, work fine but i can send filters ... my logic is create a filter and under the filter show the grid
I have this HTML

<h2>Proveedores</h2>
<div class="box k-shadow">
    <div id="grid">
        <div class="k-block">
            <div class="k-header">Filtro de búsqueda</div>
            <table>
                <tr>
                    <td>
                        <input type="text" name="nombre" placeholder="Ingrese el nombre del proveedor" class="k-textbox" />
                    </td>
                    <td style="width:100px;">
                        <select>
                            <option>Activo</option>
                            <option>Inactivo</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <button class="k-button">Limpiar</button>
                        <button id="btnFiltrar" class="k-button">Filtrar</button>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</div
And for initialize the grid i only need to use this
$(document).ready(function () {
    var config =
    {
        id: 'grid',
        url: BaseUrl('mantenimiento/ProveedorGrid'),
        columns: [
            { field: "id", title: "id", width: 50, hidden: true },
            { field: "nombre", title: "Nombre" },
            {
                command:
                [
                    {template: KendoUILinkButton(BaseUrl('mantenimiento/proveedor'), 'edit')},
                    {template: KendoUILinkButton(BaseUrl('mantenimiento/ProveedorGrid'), 'delete')}
                ],
                width: 88
            }
        ]
    };
 
    KendoUIGrid(config);
 
    $("#btnFiltrar").click(function () {
        $("#grid")
            .data("kendoGrid")
            .dataSource.filter({
                filters: [
                  { field: "nombre", operator: "startswith", value: "Paul" }
                ]
            });
    })
})
Atanas Korchev
Telerik team
 answered on 01 May 2013
3 answers
63 views
Hello,
I am attempting to have a listview that when a list item is licked, a modal window pops up with more of the objects details inside. 
Currently, I have a onclick function that successfully accesses the correct object. My question however is, how do I access the object then inside the modal view?

Here is a JSFiddle with a snippet of my code

I have found this question previously, however it has provided me with little guidance on what the solution actually was. 
Petyo
Telerik team
 answered on 01 May 2013
2 answers
169 views
The backbutton widget for Kendo Mobile version 2013.1.319 renders poorly on Android mobile browsers and PhoneGap webviews (borders extend beyond left arrow) when the platform is forced as iOS.

var app = new kendo.mobile.Application(document.body, { transition: "slide:left", platform: "ios"});

Are there any .km-ios6 .km-back css overrides that will fix this?
Brandon Peterson
Top achievements
Rank 2
 answered on 01 May 2013
7 answers
340 views
Dear all,

Is it possible to translate your kendo.ui grid, for example this message : 'Drag a column header and drop it here to group by that column' or 'Show items with value that:', etc ...

otherwise is it planned and when ?

Thanks and Regards,
Arnaud Viscusi
emidio rana
Top achievements
Rank 1
 answered on 30 Apr 2013
10 answers
389 views
Hi,
 
I am doing a quick investigation regarding the saving of a controls state. Mainly a Grid control.
 
What i am after is information about a user changing the column order, sort order, hiding/showing columns, etc. And then having these changes saved somewhere (locally most likely) so when they return to the page, these changes persist.
 
Thanks for your help.
 
Simon Gould
Steve
Top achievements
Rank 1
 answered on 30 Apr 2013
3 answers
500 views
Is there a way to show / hide the Loading-Animation by Javascript Code?

And by the way, if I load remote-data by the init-Function of a listview, the loading-Animation does not come up.
Here my code:

function mobileListViewTemplatesInit() {
        $("#termin-listview").kendoMobileListView({
            dataSource: kendo.data.DataSource.create({ transport: { read: { url: urlTermine, dataType: "json",
            data: {
                gn: id
            }} }, group: "Datum" }),
            template: $("#customListViewTemplate").html(),
            headerTemplate: "<h2 class='termin-title'>Termine am ${value}</h2>"
        });
    }


emidio rana
Top achievements
Rank 1
 answered on 30 Apr 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?