Telerik Forums
Kendo UI for jQuery Forum
4 answers
1.9K+ views
It would appear that attempting to use a RowAction (to highlight certain rows) is not working in a grid that uses Ajax binding.  I need to use Ajax binding because of the virtual scrolling.

Code:
@(Html.Kendo().Grid(Model.userMasterList)
    .Name("userMasterGrid")
    .Columns(col =>
    {
        col.Bound(c => c.userName);
        col.Bound(c => c.securityLevel);
        col.Bound(c => c.name);
        col.Bound(c => c.sifEmailInd).ClientTemplate("<input type='checkbox' #= sifEmailInd ? 'checked=checked': '' # disabled='disabled' ></input>");
        col.Bound(c => c.activeInd).ClientTemplate("<input type='checkbox' #= activeInd ? 'checked=checked': '' # disabled='disabled' ></input>");
        col.Bound(c => c.lastLoginDate);
        col.Bound(c => c.lastUpdatedDate);
        col.Bound(c => c.userId);
        col.Bound(c => c.leaNumber).Hidden(true);
    }
    )
    .Scrollable(scrollable => scrollable.Virtual(true))
    .Sortable()
    .Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
    .HtmlAttributes(new { style = "height:350px;" })
    .Events(events => events.Change("onChange"))
    .DataSource(dataSource => dataSource
        .Ajax()
        .Read(read => read.Action("UserMaster", "Account"))
        .Model(model => model.Id(i => i.userId))
        )
    .RowAction(row =>
        {
            if (!row.DataItem.activeInd)
            {
                row.HtmlAttributes["class"] = "inactiveUser";
            }
        }
        )
    )

Any help would be appreciated

Robert
Jan Olsmar
Top achievements
Rank 1
 answered on 05 Feb 2014
1 answer
141 views
I'm able to pull up data that is existing in my Everlive DB by putting in the API key. But have no clue on how to bind the 'add', 'edit', 'delete', and have the changes saved to the database. Any ideas?
Atanas Korchev
Telerik team
 answered on 05 Feb 2014
1 answer
132 views
How can I set the height of the Stockchart Navigator?

Here is my current code, however setting height of 30 obviously doesn't work:

        navigator: {
            height:30,
            series: {
                type: "area",
                field: "Sales"
            },
            select: {
                from:pastDate,
                to:currentDateString
            }
        },


Any assistance would be appreciated. Thanks.
Justin
Iliana Dyankova
Telerik team
 answered on 05 Feb 2014
1 answer
80 views
I am following the MVVM SPA pattern using kendo views and kendo router. Also, I am using RequireJS to load my js modules and html templates.

One of my templates is a simple kendo.Grid:

<DIV id="a-grid"
data-role="grid"
data-bind="source: source, events: { dataBound: dataBound, change: change }"
data-columns='[
{ "field": "aID", "title": "A", template: "#=aName( aID )#", editor: aEditor }]'>
</DIV>

It binds correctly to the source, event functions, and displays data. 
I got to work the template function by defining it in the window context:

window.aName = function ( aID ) { ... return name; };
Although, I don't like putting it into global context.

How can I define the editor and template functions in my js modules?

Thanks,

Greg.
Alexander Valchev
Telerik team
 answered on 05 Feb 2014
1 answer
55 views
I know Telerik is working on a fix for this but I wanted to post it here in the forums to help others that may run into this as well...

Basically I'm waiting for an internal build to fix this issue for me:

I have an Icenium / App Builder project that is using the latest version of Kendo UI Mobile.

As can be seen in the screenshot from the demo kendo ui icenium app when I run it on my iPad and tap an input for the username it pushes the screen pushes way up and the inputs are gone.

This doesn't happen in the simulator only on an actual iPad device.

It also doesn't happen on iPhones.

All running ios7....

Any idea what's going on or how I can fix this?

Thanks,
Nathan
Kiril Nikolov
Telerik team
 answered on 05 Feb 2014
1 answer
82 views
Is it possible to make the scheduler display in the following manner (or approximate) ?

                | 01 | 02 | 03 | 04 |  ...... 31 days                   |31|
-------------------------------------------------------------------------------
January   |Mo | Tu | We| Th  |  .......
February |Sa  | Su | Mo| Tue| ..........

If this isnt possible, whats the closest approximation that can be achieved?
Thanks in advance.
Rosen
Telerik team
 answered on 05 Feb 2014
1 answer
331 views
Hi,

I try to bind data on a select list in a template with this code


var oPersonForm =<br>[<br>    { Key: "Type", Type: "select", Label: "Type", HightLight: false, Values: [{ Key: "Type1", Value: "Type1" }, { Key: "Type2", Value: "Type2" }, { Key: "Type3", Value: "Type3" }] }<br>];<br><br>$(function ()<br>{<br>    Data.Person = {<br><br>        dsFields: new kendo.data.DataSource({<br>            transport: {<br>                read: function (options)<br>                {<br>                    options.success(oPersonForm);<br>                }<br>            }<br>        }),


<div id="personViewForm" data-role="content"><br>        <ul id="lsFields" data-role="listview" data-style="inset" data-template="ul-fromPersonTemplate" data-bind="source: dsFields"></ul><br>   </div><br><br>    <script><br>        var viewModel = kendo.observable({<br>            dsFields: Data.Person.dsFields<br>        });<br><br>        kendo.bind($("ul"), viewModel);<br>    </script><br><br><script id="ul-fromPersonTemplate" type="text/x-kendo-template"><br>    <span data-bind="text:Label"></span><br><br>    #if (Type == 'checkbox') {#<br>    <input type="checkbox" <br>            data-role="switch" <br>            name="#: Key #" <br>            data-checked="#: oPerson[Key] #" /><br>    #} else if(Type == 'select') {#<br>    <select <br>            name="#: Key #" <br>            data-value-field="Key" <br>            data-text-field="Value" <br>            data-bind="value : "Type1", source: this.Values"></select><br>    #} else {#<br>    <input type="#: Type #" <br>            name="#: Key #" <br>            value="#: oPerson[Key] #" /><br>    # } #<br></script><br>

But i have a javascript erreor and i don't undersand why, this is the error :

Uncaught TypeError: Cannot read property 'length' of null (index):1
r (index):1
s (index):1
s (index):1
F.widget.source.v.extend.itemChange (index):1
b.isFunction.i jquery-1.9.1.js:7223
n.extend.trigger (index):1
(anonymous function) (index):1
_.extend._renderItems (index):1
_.extend.insertAt (index):1
_.extend.replace (index):1
g.Class.extend.refresh (index):1
_refreshHandler (index):1
n.extend.trigger (index):1
ut.extend.query (index):1
ut.extend._query (index):1
(anonymous function) (index):1
b.extend.Deferred jquery-1.9.1.js:7541
ut.extend.fetch (index):1
_.extend.setDataSource (index):1
F.widget.source.v.extend.refresh (index):1
D.extend.bind (index):1
w.extend.applyBinding (index):1
w.extend.bind (index):1
s (index):1
a (index):1
h (index):1
_.extend.init (index):1
dt.initWidget (index):1
(anonymous function) (index):1
b.extend.each jquery-1.9.1.js:7123
b.fn.b.each jquery-1.9.1.js:6735
dt.init (index):1
ht.init (index):1
d.extend._model (index):1
d.extend.init (index):1
dt.initWidget (index):1
F.extend._createView (index):1
F.extend.append (index):1
(anonymous function) (index):1
c jquery-1.9.1.js:7341
p.fireWith jquery-1.9.1.js:7403
k jquery-1.9.1.js:9597
r
Petyo
Telerik team
 answered on 05 Feb 2014
5 answers
392 views
OK. I usually do my listviews manually (clearing and appending items from ajax results) but I really want to get endless scrolling working so i've been banging my head against the wall trying to get a very very simple example working with no success.

Here is the HTML:

<div id="test-view" data-role="view" data-title="Test" data-layout="default-layout" data-init="app.test.init" data-show="app.test.showView">
    <ul id="test-list" class="ul-content" data-role="listview">
  
    </ul>
</div>
         
<script type="text/x-kendo-tmpl" id="endless-scrolling-template">
    <li>#: name#</li>
</script>

As you can see its a simple html view with a UL inside it. Now for my JS

(function(global) { 
    var app = global.app = global.app || {};
     
    app.test = {
        init: function(e) {
            $("#test-view ul#test-list").kendoMobileListView({
                dataSource: new kendo.data.DataSource({
                    type: "json",
                    serverPaging: true,
                    pageSize: 50,
                    transport: {
                        read: {
                            url: "http://www.somedomain.com/script.php",
                            dataType: "json"
                        }
                    },
                    schema: {
                        type: "json",
                        data: function(data) {
                            return data.result;
                        },
                        total: function(data) {
                            return data.total;
                        }
                    }
                }),
                template: $("#endless-scrolling-template").text(),
                endlessScroll: true
            });
        },
        showView: function(e) {
            $("#loading-overlay").show();
            app.application.showLoading();
             
            setTimeout(function () {
                $("#loading-overlay").hide();
                app.application.hideLoading();
            }, 2000);
            e.view.scroller.reset();
        }
    };
})(window);

So in the init, its suppose to initialize the listview and pull from my php script which returns JSON. I know my service is serving up the data as you can do an alert in the data handler and see the object it returns, in addition im emailing myself in the service the results anytime a request is made.

Here is example output from my service:

{"result":[{"name":"Item 1"},{"name":"Item 2"},{"name":"Item 3"},{"name":"Item 4"},{"name":"Item 5"},{"name":"Item 6"},{"name":"Item 7"},{"name":"Item 8"}],"total":8}

As you can see its a simple object with a result value that is an array of objects each containing a name key.

The result I am getting is a javascript alert and then only a single item is in the listview

"TypeError: 'undefined' is not a function (evaluating 'n.getAttribute(\"data-\"+dt.ns+\"role\")')"..... yadda yadda in kendo.mobile.minjs

Any help would be most appreciated. I've gone down every google search and avenue i can think of. I've used only the data-attributes instead of the js initialization, etc. All with no success.

Thanks!
Kiril Nikolov
Telerik team
 answered on 04 Feb 2014
1 answer
1.2K+ views
Hi,

I use the element MultiSelect like this :

<select id="MyId" data-placeholder="My text"></select>
        
$("#MyId").kendoMultiSelect({
        dataTextField: "Name",
        dataValueField: "Id",
        itemTemplate: "<div>#:data.Name#</div>",
        dataSource: {
            type: "json",
            serverFiltering: true,
            serverPaging: true,
            pageSize: 2,
            transport: {
                read: {
                  url: DM3_Reporting.RestServiceUrl + 'fleet',
                    type: "GET"
                }
            }
        }
    });

All work fine, but I need to change the style of the data-placeholder : "MyText".

Can you tell me how can I change this style in my css ?

Thanks in advance.
Iliana Dyankova
Telerik team
 answered on 04 Feb 2014
8 answers
124 views
I opened a support ticket for this but figured I'd post in case any has a workaround that I can do in the mean time....

I put together this jsbin to illustrate the issue that I discovered. Essentially, I have a popover that call from a tabstrip item, which is inside a layout. The view that I'm calling also has the data-stretch set to true,so I don't know if that contributes to the issue. Seems to be 100% reproducible in this case.

JSBin

As you can see, if you tap the first tab item, a js error is thrown, scrollbar gets introduces, <BillMurray>Human sacrifice, dogs and cats living together... mass hysteria!</BillMurray>
well you get the idea.
Kiril Nikolov
Telerik team
 answered on 04 Feb 2014
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
Chat
DateRangePicker
Dialog
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
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?