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

I am a experience developer but a completely Kendo newbie and doing some initial tests to see if this can be a platform for our application. I have gotten a grid to work loading data from my database. But, I cannot get sorting for function for the numeric column, it always sorts as a string. I have created a model where the data type is set as number, and according to my understanding this should now parse the json data into that model and then the grid should know that this is a number, but it stills sorts as a string. Data comes from json, one line looks like this:

{"orderId":"65-68455-0b0b7","transact":"414583245","id":"414583245","paytype":"VISA","amount":"7200.00","amountBase":720000,"currency":"NOK","currencyCode":578,"test":"1","time":"2011-03-03 21:53:15","cardnomask":"XXXXXXXXXXXX0000","cardcountry":null,"refunded":0,"refundable":720000,"pids":[68455],"receipt":{"68455":false},"persons":"KEtil Test"}

My code looks like this:
$(document).ready(function() {
 
var transactionModel = kendo.data.Model.define({
    fields: {
        id: "transact",
        persons: {
            editable: false
        },
        time: {
            editable: false,
            type: "date",
        },
        transact: {
            editable: false
        },
        amount: {
            editable: false,
            type: "number",
        },
    }
});
 
var dataSource = new kendo.data.DataSource({
transport : {
read : "/wwwdocs/ajax.php",
schema : {
data : transactionModel
},
},
}
);
 
$(function() {
$("#transactions").kendoGrid({
dataSource : dataSource,
columns : [ {
field : "persons",
title : "Navn",
width : 300
}, {
field : "time",
title : "Tid",
width : 160,
}, {
field : "transact",
title : "Transaksjons-id",
width : 160
}, {
field : "amount",
title : "Sum",
width : 160
}, ],
filterable : true,
sortable : true,
groupable: true,
});
});
});
Ketil
Top achievements
Rank 1
 answered on 02 Dec 2013
1 answer
413 views
Hi,
I am trying to get the functionality seen here:
http://www.jtable.org/
If you add or edit a row, there is some nice css that highlights the row.

What I have tried so far (using the MVC wrappers):
.Events(e => e
        .Save("onSave")
)

function onSave(e) {
        var grid = $("#grid").data("kendoGrid");
        var id = e.model.ID;
        var uid = grid.dataSource.get(id).uid;
        $("#grid tbody").find("tr[data-uid=" + uid + "]").addClass("row-changed");
}

.row-changed {
        background-color: red;
 }

Nothing is happening :(
Thanks!
Iliana Dyankova
Telerik team
 answered on 02 Dec 2013
2 answers
121 views
I'm trying to get MVVM working with KendoUI Mobile and am receiving the error as stated, "Object #<Text> has no method 'getAttribute'" (kendo.all.min.js:12)

The binding DOES appear to be working, but the rending of the page is very messed up.  For example, I do see a list of items with the #: linkText # that I'd expect, except the view no longer looks like an iPhone, the links don't work, and there is some weird styling going on (for reference, I've attached screenshots of the data-binded listview and a version with hardcoded <li> items -- that is, the only between the pages is how the <li>'s are created)

Anyways, I have a view and template, like this:
<div data-role="view" id="home-view" data-layout="default" data-title="Hello World!"
     data-init="app.views.home.init"
     data-before-show="app.views.home.beforeShow"
     data-show="app.views.home.show"
     data-model="app.views.home.viewModel">
 
    <ul data-role="listview" data-bind="source: navigation" data-template="navigation-template"></ul>
</div>
 
<script id="navigation-template" type="text/x-kendo-template">
    <li>
        <a href="#: url #">#: linkText #</a>
    </li>
</script>

And the script that looks like this:
define(["kendo"], function (kendo) {
    return {
        init: function (initEvt) {
 
        },
        beforeShow: function (beforeshowEvt) {
 
        },
        show: function (showEvt) {
 
        },
        viewModel: kendo.observable({
            navigation: [
                {
                    linkText: 'My Data',
                    url: 'myData'
                },
                {
                    linkText: 'My Purchase Requests',
                    url: 'myPurchaseRequests'
                },
                {
                    linkText: 'My Purchase Orders',
                    url: 'myPurchaseOrders'
                },
                {
                    linkText: 'Pending PR Tasks',
                    url: 'pendingPrTasks'
                },
                {
                    linkText: 'Pending PO Tasks',
                    url: 'pendingPoTasks'
                }
            ]
        })
    }
});

Thomas
Top achievements
Rank 1
 answered on 02 Dec 2013
3 answers
3.4K+ views
I have an upload widget outside the grid asynchronously uploading files. Upon completion I try to refresh the grid displaying details about these files. However, when I call grid.dataSource.read() the grid datasource is not making a request to the remote service to get new data. I already set cache=false in the transport. I even try to call the read() method in the browser (chrome) console and it still doesn't cause a request to the remote service. Can you see what is wrong?

001.$(document).ready(function() {
002.    var $grid = $("#samples-all").kendoGrid({
003.        dataSource: {
004.            transport: {
005.                read: "/uploads/",
006.                dataType: "json",
007.                create: {
008.                  /* don't cache grid items, otherwise miss new uploads */
009.                  cache: false
010.                }
011.            },
012.            schema: {
013.                data: "rows",
014.                total: "totalRows"
015.            },
016.            pageSize: 20,
017.            serverPaging: true,
018.            serverFiltering: true
019.        },
020.        pageable: true,
021.        scrollable: false,
022.        filterable: {
023.            extra: false,
024.            operators: {
025.                string: {
026.                    eq: "Is equal to",
027.                    neq: "Is not equal to"
028.                }
029.            }
030.        },
031.        columns: [
032.            {
033.                field: "threat_presence",
034.                title: " ",
035.                template: kendo.template($("#tp-template").html(), { useWithBlock: false }),
036.                width: 29,
037.                filterable: {
038.                    ui: threatFilter
039.                }
040.            },
041.            {
042.                field: "file_name",
043.                title: "Name",
044.                template: kendo.template($("#file-name-template").html(), { useWithBlock: false }),
045.                width: 250,
046.                filterable: false
047.            },
048.            {
049.                field: "file_type",
050.                title: "Type",
051.                filterable: false
052.            },
053.            {
054.                field: "file_count",
055.                title: "File Count",
056.                width: 55,
057.                filterable: false
058.            },
059.            {
060.                field: "sha1",
061.                title: "SHA1",
062.                width: 250,
063.                filterable: false
064.            },
065.            {
066.                field: "message",
067.                title: "Status",
068.                width: 70,
069.                filterable: false
070.            },
071.            {
072.                field: "inserted",
073.                title: "First Seen",
074.                filterable: false
075.            },
076.            { command: { text: "Download", click: download }, title: " ", width: "85px" }
077.        ]
078.    }).data("kendoGrid");
079.    // setup the upload window and toolbar button
080.    var $uploadWindow = $("#uploadWindow"),
081.        $btnUpload = $("#btnUpload").on("click", function() {
082.            $uploadWindow.data("kendoWindow").open();
083.        });
084. 
085.    if (!$uploadWindow.data("kendoWindow")) {
086.        $uploadWindow.kendoWindow({
087.            width: "400px",
088.            title: "Upload",
089.            visible: false
090.        });
091.    }
092.    $("#upload-file").kendoUpload({
093.        async: {
094.            saveUrl: "/upload-samples/",
095.            removeUrl: "remove",
096.            autoUpload: false
097.        },
098.        upload: onUpload,
099.        success: onUploadSuccess,
100.        complete: onUploadComplete
101.    });
102.     
103.    function onUpload(e) {
104.        // omitted
105.    }
106.    function onUploadSuccess(e) {
107.        // omitted
108.    }
109.    function onUploadComplete(e) {
110.        console.log(e);
111.        var grid = $("#samples-all").data("kendoGrid");
112.        grid.dataSource.read();
113.        grid.refresh();
114.    }
115.});
html:
<div id="samples-list-container">
    <div id="samples-all"></div>
</div>
Alexander Valchev
Telerik team
 answered on 02 Dec 2013
1 answer
143 views
Method value() returns an array reference of selected values which is not a desirable behaviour. Method value() should return cloned array instead.

If I get selected values by calling method value() into variable eg. selectedValues and then later set those selected values by calling value(selectedValues) the control is empty, because kendoMultiSelect is modifying the same array object. I need to clone those array which i think should be done in kendoMultiSelect.value() method.

Please see working example on 

http://jsbin.com/eYUwUqA/1/edit

Best regards

Luka Robnik
Georgi Krustev
Telerik team
 answered on 02 Dec 2013
2 answers
106 views
I have a situation where I need to retrieve some data from my server, and then populate my view model with it. However when I do that, the bindings get overwritten. So I have a function to re-wire the functions and such for all of the various objects, and this seems to work fine; Except for this one situation where a sub-array of a top level property has an onCreate function.

The best I can see, when I start the page, the onCreate function has a property called "guid'. When I use the set function to apply the server side data to the array, that property is taken away, and I cannot seem to get it back. So the Click event fails with an error.

I have a jsBin sample here;

jsBin

Daniel
Telerik team
 answered on 02 Dec 2013
1 answer
141 views
I've created a Kendo Grid and need to add a column containing a hyperlink to a controller action that supplies the clicked row's ID.  The grid would look like:

ID|Name|Product|Other|Edit, where the edit column links to '~/controller/action/currentRowID'.  

The grid is working perfectly, all that's needed is the 'Edit' row.  I'm using MVC4 using an ajax datasource.  Please help!  I cannot find anything on the web that describes how to accomplish this.
Dimiter Madjarov
Telerik team
 answered on 02 Dec 2013
3 answers
119 views
Hi,

I've a problem with multiple of your sample apps when running e.g. on an iPhone or iPad.

e.g. If I go to http://demos.kendoui.com/mobile/m/index.html#/mobile/m/tabstrip/index.html and select the rating tab then I go to another browser tab or another app. When returning to the tabs trip sample safari might reload the page.

expected result: I see the same page after returning

result: I get an empty page

you can force this by touching reload. Again expected result: seeing the page I've seen before. Result: empty page

I have seen this behavior in all of your samples. So I'm wondering if that's broken by design or how it can be fixed?

Petyo
Telerik team
 answered on 02 Dec 2013
2 answers
81 views
Hi,

I use Kendo DateTimePicker that can set Min/Max of the widget, set a range time stamp that I can select in this widget. For example,
Set interval = 30, min=  new Date(2013,11, 12, 10, 0, 0), max = new Date(2013, 11, 12, 20, 0, 0)
I can select range from 2013-11-12 10:00 to 2013-11-12 20:00, include the 2 points of start and end.

But when set interval = 30, min=  new Date(2013,11, 12, 10, 0, 0), max = new Date(2013, 11, 12, 10, 0, 0).
I think there should only a value can be select in widget, but it will return a wrong list.

Thanks,
Chuanlong 
Chuanlong
Top achievements
Rank 1
 answered on 02 Dec 2013
11 answers
290 views
Hi,

I updated to iOS 7 and xCode 5 and Drawer doesn't recognize swipe gestures (i.e. left-to-right) anymore performed on iOS 7 device or in iOS Simulator.
It's working as expected on local browser and was working on ios 6 device.
I'm using kendoui.mobile.2013.2.912.commercial wiht new ios 7 theme.

Any suggestions?
Thanks in advance


 
upvision
Top achievements
Rank 1
 answered on 01 Dec 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?