Telerik Forums
Kendo UI for jQuery Forum
9 answers
125 views
My grid looks like this:

@(Html.Kendo().Grid<Biblioteka.ViewModels.BookViewModel>()
    .Name("BooksKendoGrid")
    .Columns(columns =>
    {
        columns.Bound(p => p.Title);
        columns.Bound(p => p.Author);
        columns.Bound(p => p.GenreName);
        columns.Bound(p => p.ReleaseDate).Format("{0:d}");
        columns.Bound(p => p.ISBN);
        columns.Bound(p => p.BorrowCount);
        columns.Bound(p => p.RealBookCount);
        columns.Bound(p => p.AddDate).Format("{0:d}");
        columns.Bound(p => p.ModifiedDate).Format("{0:d}");
        columns.Bound(p => p.BookId).Width(150).ClientTemplate("<input type=\"button\" value=\"Edit #= Title #\" style=\"width : 100px;\" onclick=\"openEditWindow(#= BookId #)\"/>"); 
    })   
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()
    .HtmlAttributes(new { style = "height: 200px" })
    .DataSource(dataSource => dataSource
         
                .Ajax()
                .PageSize(2)
                .Model(model =>
                {
                    //The unique identifier (primary key) of the model is the ProductID property
                    model.Id(p => p.BookId);
                })
                       .Read(read => read.Action("BooksKendoGridRead", "Raports")
                  
     )

 
        )
    )

As you can see I had enabled Pageable and I set .PageSize to 2 but it doesn't work it cut other elements in grid ... and leave only 2 
Karol
Top achievements
Rank 1
 answered on 29 Nov 2012
2 answers
81 views
When I use "onclick" then first time it will not fire, the second time it fires but then my other links stop working,

I use PhoneGap/Cordova on Android

Any suggestions? Here is my code:
<!DOCTYPE html>
<html>
<head>
    <title>TEST</title>
 
    <script src="cordova-2.2.0.js"></script>
 
    <script src="js/jquery.min.js"></script>
    <script src="js/kendo.mobile.min.js"></script>
 
    <link href="css/kendo.common.min.css" rel="stylesheet" />
    <link href="css/kendo.mobile.all.min.css" rel="stylesheet" />
</head>
 
<body>
     
    <div id="div1" data-role="view" data-title="Hello World">
     
    <h2>Hello App</h2>
 
    <ul data-role="listview" data-style="inset" data-type="group">
        <li>Please select:
            <ul>
                <li data-icon="play"><a href="Page1.html">Page 1</a></li>
             
                <li data-icon="play"><a href="#" onclick="test1();">Test</a></li>
            </ul>
        </li>
    </ul>
</div>
 
 
 
    <script>
        window.kendoMobileApplication = new kendo.mobile.Application(document.body);
         
        function test1()
        {
            alert('hello there...');
        }
         
    </script>
     
 
</body>
</html>
Petyo
Telerik team
 answered on 29 Nov 2012
1 answer
210 views
Hi,

          My simple apps needs to point a website for example (www.mywebsite.com).  And when it display the page, it should show the whole page and the user can zoom in or out. 
         
           Please let me know on how to do it or whatever KendoUI can do about it.

Thanks
Petyo
Telerik team
 answered on 29 Nov 2012
1 answer
272 views
I am using MVC.
I am having some difficulty in creating a filter for a column 'Name' where startswith 0-9

grid.dataSource.filter([
    { field: "Name", operator: "startswith", value: "0" },
    { field: "Name", operator: "startswith", value: "2" },
    { field: "Name", operator: "startswith", value: "3" },
    { field: "Name", operator: "startswith", value: "4" },
    { field: "Name", operator: "startswith", value: "5" }
]);
Above is abbrieviated....
Basically i have a text field 'Name' and i need to show any record that starts with 0-9.

Seems like no matter which way i phrase the filter, the filter on the DataSourceRequest never haves more that two filters (CompositeFilter).

Any help would be great. thanks.  Logically i know i could have ten colums and filter by all ten columns for some value so my feeling is internally it is grouping by "Name" b/c the demos only support two filters per column.

-Trent
Atanas Korchev
Telerik team
 answered on 29 Nov 2012
1 answer
78 views
I have the following template: 
        <script type="text/x-kendo-template" id="recentPostListViewTemplate">
            <div id="#= id #" data-role="touch" data-tap="myTouch.tap">#= title #</div>
            <div class="articleBody" id="body-#= id #">
            #= content #<br>
            <a href=#= custom_fields.syndication_permalink[0] #>Read Full Story</a>
            </div>
        </script>
It works great at first. Once I add to the list view using endless scroll the newly generated items aren't tappable. This is my myTouch section:
window.myTouch = {
    tap : function(e) {
        var id = e.touch['target']['context']['id'];
        console.log(id);
        $('#body-' + id).toggle();
    }
}
Is there something I have to do to get this to work on the newly generated list view items? I tried the old stand by of an onClick event but just doesn't work right on the iPhone.

Thanks.
Petyo
Telerik team
 answered on 29 Nov 2012
1 answer
81 views
Hi,

Is it possible to have Kendo UI widgets + DataViz widgets on the same page?
I wanted to have Grid(Popup Editing, Inline Editing etc.), Slider, AutoComplete, Rich Text Field and a Scatter Chart on the same page.
I have downloaded the latest trial package - kendoui.trial.2012.3.1114

I have added the files as below..

    <link href="../../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../../styles/kendo.common.min.css" rel="stylesheet">
    <link href="../../../styles/kendo.default.min.css" rel="stylesheet">

    <script src="../../../js/jquery.min.js"></script>
    <script src="../../../js/kendo.web.min.js"></script>
    <script src="../../content/shared/js/console.js"></script>
    <script src="../../../js/kendo.dataviz.min.js"></script>

But on adding "kendo.dataviz.min.js", other widgets seems to misbehave.
How to overcome this and have both UI widgets and DataViz widgets on the same page..???


Thanks,
Vishnu
Atanas Korchev
Telerik team
 answered on 29 Nov 2012
1 answer
155 views

 How can the layout be programmatically changed to show a different layout for a view.
I have several layouts with different button configurations that need to change due to the views state.  The native ios changes headers with a cross-fade to different button selection.  


~thanks
Petyo
Telerik team
 answered on 29 Nov 2012
1 answer
92 views
Some cases grouping not working with error found in firebug is

TypeError: a is undefined
http://localhost:1467/Scripts/kendo.web.min.js
Line 8

and page getting hang with loading image.
Atanas Korchev
Telerik team
 answered on 29 Nov 2012
1 answer
78 views
Hi,

Is there a way to sync an element after create was called?
EX: In edit or update there are only a number of field that are actually set by user the rest are only information. While displaying editor I do not want to pull reference information however the new value returned from controller is being ignores.
// I have a data source defined
Workbench = new kendo.data.DataSource({
    transport: {
        create: {
            url: "/api/workbench",
            type: "POST"
        }
    }
})
// I add a new object to Data source
Workbench.add({...});
// and call sync the action on workbench
// controller returns a new object with id and other
// properties set however I think the return is being
// ignored
Workbench.sync();
Rosen
Telerik team
 answered on 29 Nov 2012
2 answers
199 views
For some strange reason, the GroupName column returns a null value to the controller even though I enter a value into the grid UI. The GroupDescription column passes the entered value successfully. Both columns are strings except GroupName is a required field in the GroupVM view model. The work around is that I have to use a clientemplate for GroupName (see below)

THIS WORKS: columns.Bound(p => p.GroupName).ClientTemplate("#=GroupName #").Title("Group Name");
THIS DOES NOT WORK: columns.Bound(p => p.GroupName).Title("Group Name");



@model IEnumerable<
ViewModels.GroupVM>
 
@(Html.Kendo().Grid<ViewModels.GroupVM>()
 
.Name("GroupGrid")
    .ToolBar(toolbar => toolbar.Create().Text("Create"))
                .Editable(editable => editable.Mode(GridEditMode.InLine))
                .Pageable()
                .Sortable()
                .Scrollable()
.Columns(columns =>
     {
         columns.Bound(p => p.GroupId).Hidden();
         columns.Bound(p => p.GroupName).ClientTemplate("#=GroupName #").Title("Group Name");
         columns.Bound(p => p.GroupDescription).Title("Group Description");
         columns.Command(command => { command.Edit(); }).Width(200);
     })
          .DataSource(dataSource => dataSource
                    .Ajax()
                    .Model(model =>
                            {
                                model.Id(p => p.GroupId);
                            })                    
                        .Events(events => events.Error("error_handler"))
                        .Create(update => update.Action("ManageGroups_C", "Group"))
                        .Read(read => read.Action("ManageGroups_R", "Group"))
                        .Update(update => update.Action("ManageGroups_E", "Group"))
                )
     )
 
      <script type="text/javascript">
         function error_handler(e) {
             if (e.errors) {
                 var message = "Errors:\n";
                 $.each(e.errors, function (key, value) {
                     if ('errors' in value) {
                         $.each(value.errors, function () {
                             message += this + "\n";
                         });
                     }
                 });
                 alert(message);
             }
         }
</script>
Vladimir Iliev
Telerik team
 answered on 29 Nov 2012
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
Date/Time Pickers
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
Gauges
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
ScrollView
PivotGridV2
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Collapsible
Localization
MultiViewCalendar
Touch
Breadcrumb
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
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?