Telerik Forums
Kendo UI for jQuery Forum
4 answers
1.0K+ views

I'm using a row template defined as:

<script type="text/x-kendo-template" id="rowTemp" >
                      
<tr id="tr_#= id #" >
    <td>#= id #</td>
    <td>#= simbol #</td>
                                  
             <td><input type="checkbox" name="add_#= id #" value="#= id #" id="add_#= id #" class="add"  /></td>
                      
    <td align="center"><input type="button" class="info  k-button k-button-icontext" name="info" value="Info" id="info_#= id #" style="height: 26px; margin: 0px 2px; min-width: 64px;" /></td>
  
</tr>
</script>

 This button when clicked should open a new window. 

$(" .info ").click(function (e) { 
                     
     var infowindow = $("#info_win")
                      .kendoWindow({ 
                            title: "Info",
                            modal: false,
                            visible: false,
                            resizable: true,
                            width: 300,
          content: "someContent"
                        }).data("kendoWindow");
                                          
        infowindow.center.open();
                      
  });

In this post states that template should be defined also in the column definition. So my grid looks something like that:

$("#grid").kendoGrid({
         dataSource: {
                data: data,
                schema: {
                    model: {
                        fields:{
                             id: { type:"number"},
                             simbol: { },
                           add:{}                       
                           info:{},                     
                       }
                     }
               }
                columns: [{
                     field: "add",
                     template:'><input type="checkbox" name="add_#= id #" value="#= id #" id="add_#= id #" class="add"  />',
                    title: "Add",
                     },                     
                      
                 field:"info"
                  template: '<input type="button" class="info  k-button k-button-icontext" name="info" value="Info" id="info_#= id #" style="height: 26px; margin: 0px 2px; min-width: 64px;" />',
                  title: "",                        
                  }],
                  rowTemplate: kendo.template($("#rowTemp").html()),
});

But buttons are still not working.

Am I missing something? Please help.

Anica
Top achievements
Rank 1
 answered on 16 Sep 2012
1 answer
75 views
I downloaded basic sample and getting errors left and right. jQuery mobile loaded without problems.

Im testing in Eclipse/Android.
Nikita
Top achievements
Rank 1
 answered on 16 Sep 2012
11 answers
292 views
It appears as though attempting to use kendo.bind to bind elements to a kendo data source object does not work correctly with mobile controls. Specifically with list view, the mobile namespace is ignored which causes issues with the data source. I have noticed an extra namespace parameter in the bind function, but even if mobile namespace is passed as a parameter, the issue remains. I've also noticed that none of the mobile demos make use of the kendo data source object, rather they use the data source property of the control. Is this a limitation of the mobile controls or am I missing something? Thanks
James
Top achievements
Rank 1
 answered on 15 Sep 2012
5 answers
406 views
I make a simple treeview with some nodes and drag/drop possibility. Drag/drop working fine inise treeview and between nodes.
But, I can't drag node outside treeview. For example, I want drag nodes (=gather information about nodes) into DIV element.
I set handler for "drag" event, but this handler empty and don't modify node state. However, I can't drag node into external DIV at same page - node status automatically set like "k-denied".

How I can correct this behaviour? Is this by design or my mistake?
Denis
Top achievements
Rank 1
 answered on 15 Sep 2012
4 answers
625 views
Hi,

Is there a way to ensure that new rows always get added to the same position in the grid (either the top or bottom)?

At the moment, we are finding that if the grid has not been sorted a new row is always added to the top. But once the grid has been sorted, the new row seems to be added to a random position

Thanks

Chris
Volodymyr
Top achievements
Rank 1
 answered on 15 Sep 2012
0 answers
47 views

Android 2.3 simulator, KendoUI demo (Mobile overview), I have deleted the header section, display good on explore, but when I build it to PhoneGap native app, the TabStrip goes to top of android simulator.

Thanks for your help!

Damien
Top achievements
Rank 1
 asked on 15 Sep 2012
0 answers
108 views
Hello, I'm Develop Application Use SLIM PHP FRAMEWORK, IDIORM, PARIS, TWIG & KENDOUI.
I Get Response filteringServer with this : 
"filter":{
    "filters":[
        {"logic":"or","filters":[
            {"field":"NAME","operator":"eq","value":"Rosadi"},
            {"field":"NAME","operator":"eq","value":"Rahmat"}
            ]},
        {"logic":"or","filters":[
            {"field":"GENDER","operator":"eq","value":"L"},
            {"field":"GENDER","operator":"eq","value":"P"}
        ]}
    ],"logic":"and"}

and I want generate filtering Server Dynamically using php
<?
$Filter = $_REQUEST["filter"];
if(isset($Filter))
{
    foreach($Filter["filters"] as $FilterColumn)
    {
        $employeeList = $employeeList ->where($FilterColumn['field'], $FilterColumn['value']);
    }
}
?>

the php code above is wrong, make me get stuck.
can anyone help me how make filtering dynamically (the response implement in php code)  ?
sorry for my bad english.
Rizky
Top achievements
Rank 1
 asked on 15 Sep 2012
2 answers
143 views
Hi,

I am developing a MVVM application and I am using KendoUI Grid. In the grid I want to get the onChange event when user change the pages. (I have been able to do this without MVVM). To do this, I have used the following element.

data-pageable='{ "pageSize": 2 events: {change: onPage}}' //This is not working

I want to the program to execute the onPage function when user changes the pages.
Any help is appreciated.
Thank you.
Sunil TVL
Top achievements
Rank 1
 answered on 15 Sep 2012
2 answers
190 views
Hi,

I am currently trying to get the following snippet of code from your Kendo MVC examples project to work. Unfortunately it seems as though having logic in the ClientTemplate on a column (ShipName) in the child grid(in the kendo-templ) causes issues. Any ideas how to get around this?

All help will be massively appreciated.

Jean Hibbert

@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.EmployeeViewModel>()
        .Name("Employees")
        .Columns(columns =>
        {
            columns.Bound(e => e.FirstName).Width(140);
            columns.Bound(e => e.LastName).Width(140);
            columns.Bound(e => e.Title).Width(200);
            columns.Bound(e => e.Country).Width(200);
            columns.Bound(e => e.City);
        })
        .ClientDetailTemplateId("employeesTemplate")
        .Pageable()
        .DataSource(dataSource => dataSource
            .Ajax()
            .Read(read => read.Action("HierarchyBinding_Employees""Grid"))
            .PageSize(5)
        )
        .Sortable()
        .Events(events => events.DataBound("dataBound"))
)

<script id="employeesTemplate" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.OrderViewModel>()
            .Name("Orders_#=EmployeeID#")
            .Columns(columns =>
            {
                
                columns.Bound(o => o.OrderID).Width(101);
                columns.Bound(o => o.ShipCountry).Width(140);
                columns.Bound(o => o.ShipAddress).Width(200);
                
                columns.Bound(o => o.ShipName)
                .ClientTemplate("#= ShipName? 'XXX' : 'YYY' #")
                .Width(200);
            })
            .DataSource(dataSource => dataSource
                .Ajax()
                .Read(read => read.Action("HierarchyBinding_Orders""Grid"new { employeeID = "#=EmployeeID#" }))
            )
            .Pageable()
            .Sortable()
            .ToClientTemplate()
    )
</script>
<script>
    function dataBound() {
        this.expandRow(this.tbody.find("tr.k-master-row").first());
    }
</script>

Jean
Top achievements
Rank 1
 answered on 14 Sep 2012
8 answers
388 views
These seems to be an issue with using MVVM binding for a mobile app  as I took the web example Web MVVM remote-binding and just changed the libraries to:

script src="../js/jquery.min.js"></script>
<script src="../js/kendo.mobile.min.js"></script>
<script src="../js/kendo.binder.min.js"></script>

Now in Google Chrome debugger I see the exception:
Uncaught ReferenceError: ProductID is not defined

As I look in Fiddler I see that the service (JSONP) call was never issued and must
believe this is the issue. Hopefully MVVM binding can be made to work in
the mobile app as I am evaluating Kendo against Sencha Touch which has
 a wonderful built in MVC pattern. I will not let code be written here
 without use of patterns like MVC abd MVVM so this is not a nice feature
 but a requirement in our choice.

I then made a couple of changes to the code that seemed promising:

1. I added a statement to force the read after the viewModel definition

 

viewModel.productsSource.read();
    Now I see the JSON data in Fiddler with the ProductID but still get the same error. Now I understand that
the datasource should contain observables which should cause the data binding to occur when the JSON data is read. This does not seem to be happening so I added a change method to the datasource that fires wnen the data has been read.It looks like:
change:function() {
       kendo.bind($("#form-container"), viewModel);
},
Now I place a breakpoint on this line and it is hit and the same exception is occuring, hopefully I am missing the obvious! The complete code looks like (HTML is unchanged from example)

var crudServiceBaseUrl = "http://demos.kendoui.com/service";
 
       $(document).ready(function() {
           var viewModel = kendo.observable({
               productsSource: new kendo.data.DataSource({
                   transport: {
                       read: {
                           url: crudServiceBaseUrl + "/Products",
                           dataType: "jsonp"
                       },
                       update: {
                           url: crudServiceBaseUrl + "/Products/Update",
                           dataType: "jsonp"
                       },
                       destroy: {
                           url: crudServiceBaseUrl + "/Products/Destroy",
                           dataType: "jsonp"
                       },
                       parameterMap: function(options, operation) {
                           if (operation !== "read" && options.models) {
                               return {
                                   models: kendo.stringify(options.models)
                               };
                           }
                           return options;
                       }
                   },
                    change: function() {
                       kendo.bind($("#form-container"), viewModel);
                   },
                   batch: true,
                   schema: {
                       model: {
                           id: "ProductID"
                       }
                   }
               }),
               selectedProduct: null,
               hasChanges: false,
               save: function() {
                   this.productsSource.sync();
                   this.set("hasChanges", false);
               },
               remove: function() {
                   if (confirm("Are you sure you want to delete this product?")) {
                       this.productsSource.remove(this.selectedProduct);
                       this.set("selectedProduct", this.productsSource.view()[0]);
                       this.change();
                   }
               },
               showForm: function() {
                  return this.get("selectedProduct") !== null;
               },
               
           });
           viewModel.productsSource.read();
           
       });

 

 

 

 

 

 


 


john
Top achievements
Rank 1
 answered on 14 Sep 2012
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
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
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
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
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?