Telerik Forums
Kendo UI for jQuery Forum
3 answers
261 views
How can we add data to the HTML headers sent by the data source?
Is there a function or property that will do this?

Something like this would be a simple fix as JQuery 1.5.* supports adding
a "headers" map to add any custom headers you want.

                        transport: {
                            read: "http://localhost/WebAPITest/api/Transactions",
                            datatype: "json",
                            headers: { Authorization: "user/password" }
                        },

Thanks
Gary
Top achievements
Rank 1
 answered on 13 Apr 2012
1 answer
125 views
Hello,

Can you provide several examples for MVVM with TreeView and a JSON DataSource ?

Best Regards,
Guillaume
Kyle
Top achievements
Rank 1
 answered on 13 Apr 2012
0 answers
76 views
Hello

Items CAN USE Kendo in functions

sample :

this.ComboBox = this.kendoComboBox();
this.ComboBox.setName("COMBOID");
this.ComboBox.setWidth(550);
this.ComboBox.setHeight(33);
this.ComboBox.setIndex(0);
this.ComboBox.setdataTextField("Name");
this.ComboBox.setdataValueField("ID");
this.ComboBox.setFilter("Contains");
this.ComboBox.setDataType("odata");
this.ComboBox.setserverFiltering("true");
this.ComboBox.setServerPaging("true");
this.ComboBox.setPageSize("20");

would generate the following results will :

$("#comboBox").kendoComboBox({       
index: 0,       
dataTextField: "Name",       
dataValueField: "Id",       
filter: "contains",       
dataSource: {           
type: "odata",           
serverFiltering: true,           
serverPaging: true,           
pageSize: 20,           
transport: {               
read: "http://odata.netflix.com/Catalog/Titles"            }        }    });


thanks.

Taha
Top achievements
Rank 1
 asked on 13 Apr 2012
0 answers
119 views
What is the easiest way to dynamically insert html content into a kendo PanelBar?  For example I would like to place checkboxes next to item titles.  Is there a flag like 'encoded' for the Treeview? 
Mike
Top achievements
Rank 1
 asked on 13 Apr 2012
0 answers
100 views
I have a suggestion that would simplify the way to retrieve specific cell values from data items when selecting multiple rows from a grid.

Right now, the only clean way to get cell values from selected rows would be to get the selected elements with grid.select(), then go through all the rows and then build your own array with the desired cell values.

Why not implement something like this:

var usernames_and_emails = grid.dataItems(grid.select(), ["username", "email"]);

The usernames_and_emails variable would contain all the selected rows as javascript objects, each object having the username and email properties.
If the second parameter is omitted for the .dataItems() method, then it should get all the columns for the grid.

Also, it would be nice to have a method to get a single column instead of an array of objects

for example

var user_ids = grid.dataItemsColumn(grid.select(), "id");

user_ids would be an array with ids.

I think this way it would be a bit easier to fetch data when working with multiple rows.

---------------------
Long story short

dataItems (tr_array  [, fields_array])
returns an array of data items for the specified tr elements in the "tr_array"
if the "fields_array" is specified, only the fields specified in the array are returned

dataItemsColumn(tr_array, field_name);
returns an array of cell values (indicated by "field_name") for the specified tr elements in the "tr_array"

I guess this would eliminate the use of writing some repetitive code or implementing a custom function.

Gabriel.
Gabriel
Top achievements
Rank 1
 asked on 13 Apr 2012
0 answers
78 views
Hi,

I am trying to set the width of dropdonw in relative term (i:e in %)  the dropdown  appearss find but when i click on the drop down list
I am able to see the data also . but the width of the list is not matching with the width of dropdown list.  when i assign the width in px it works fine . what could be causing this issue.

AD

Anil
Top achievements
Rank 1
 asked on 13 Apr 2012
1 answer
116 views
Hi,

When I set the dropdownlist width in relative terms say 45%, the drop down appears fine but I am not able to see the list of data and only the scroll bar is visible. dropdownlist is fine when the width is set in px. What could be causing this issue?

J
Anil
Top achievements
Rank 1
 answered on 13 Apr 2012
0 answers
80 views
Hi, exists some way for using a grid where the fields for edition some distinct to fields for adding?
I need a grid with editing popup with some fiels for update, and other fields are for adding.

Thanks
Juan
Top achievements
Rank 1
 asked on 13 Apr 2012
4 answers
1.8K+ views
I am using a simple template and rendering the html using $("#main").html(kendo.render(template, repairs));.  Since I am just dealing with local data, I felt there was no need for a datasource, but when I add an item to the repair array I would like to have it update the html via the template.  I am using $("#main").html(kendo.render(template, repairs));  again to do that right now, but is there a better way?  Thanks.

Wade      
<script id="template" type="text/x-kendo-template">
    <div id="content">
        <div id="RepairNum">
            Repair:#= RepairNum # 
            Customer:#= CustomerName #
        </div>
    </div
</script>

<script>
 
    function Repair(repairNum,customerName) {
        this.RepairNum = repairNum;
        this.CustomerName = customerName;
    }
 
    var repairs = new Array();
    repairs.push(new Repair("111111","Test1"));
    repairs.push(new Repair("222222","Test2"));
    repairs.push(new Repair("333333","Test3"));
     
    $(document).ready(function() {
     
        var template = kendo.template($("#template").html());
        $("#main").html(kendo.render(template, repairs));
         
        $("#addButton").click(function(){
            //Attempt to get the customer name
            var repairNum = $("#repairnum").val();
 
            $.get('/app/json.mx', {RepairNum : repairNum},
                function(data)
                {
                    repairs.push(new Repair(repairNum,data));
                    $("#main").html(kendo.render(template, repairs));  
                });
 
            $("#repairnum").val("");
            $("#repairnum").focus();
 
 
        });
 
    });
</script>

















Alexander Valchev
Telerik team
 answered on 13 Apr 2012
1 answer
606 views
Hi, I'm using the kendo UI grid without using the dataprovider(including the transport object) because we are using server sides pushed data.

All I want to do is when i click delete on the grid, or add, catch that event and do some stuff.

however I can't get the listener to kick off. Iv'e tried 2 methods outlined in the docs, but I think its because i'm not using the data provider?

$("#grid").kendoGrid({
               columns: [
               "Id",
               "HostName",
               "BaseUri",
               { field: null,command: "destroy"}
               ], 
               editable: true,
               remove: function(row) {alert("removed");}
           });
and 
$("#grid").kendoGrid({
     remove
: function(e) {
         
// handle event
 
});
have not been working for me

This is how i'm refreshing the data
$("#grid").data("kendoGrid").dataSource.data(message).read();

I also had the same issue using the toolbar[] to define the destroy button.

Looking at my console it looks like its trying to call destroy in the data provider but again i'm not using that 

  1. h.extend._modelForContainerkendo.all.min.js:11
  2. h.extend.removeRow <- there's the event i'm trying to catchkendo.all.min.js:11
  3. h.extend._editablekendo.all.min.js:11
  4. f.event.dispatchjquery.min.js:3
  5. f.event.add.h.handle.i
Alexander Valchev
Telerik team
 answered on 13 Apr 2012
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?