Telerik Forums
Kendo UI for jQuery Forum
1 answer
196 views
I wanted to use observable object for my grid, hoping that the performance would be better then what i was getting before.
but i am not sure if it is. I also am confused about the usage.
It seams to be pretty much the same thing.

[I use TypeScript, that's why the code looks a little bit different to pure JS]

When i add a new item.
With the old way i did something like this:
static gridItems: cGridItem[] = [];
 
gridItems.push(item);
 
var grid = $("#grid").data("kendoGrid");
grid.setDataSource(gridItems);
grid.dataSource.read();
then i changed it to observable object way like this:

// Define a DataSource
    static gDataSource = new kendo.data.DataSource({
        data: tsDataManager.gridItems
    });
 
    // Create an observable object.
    static vm = kendo.observable({
        items: tsDataManager.gDataSource
    });
 
tsDataManager.gDataSource.add(item);
Can't see any performance differences.

The weird thing is when i try to edit the items.
In the old way i did this:
var grid = $("#vmGrid").data("kendoGrid");
var item = grid.dataSource.get(id);
item.TimeStamp = tStamp;
               item.Close = aInfo.Last;
               item.Price = aInfo.Last;
               item.NetChange = aInfo.Net;
               item.AskPrice = aInfo.AskPrice;
               item.AskSize = aInfo.AskSize;
               item.BidPrice = aInfo.BidPrice;
               item.BidSize = aInfo.BidSize;
               item.TotalVolume = aInfo.Volume;
 
grid.refresh();
i expected not to have to run the grid refresh with the observable object. But it turns out i still had to do it. or it would not show any changes.
The new code loos like this:
var grid = $("#vmGrid").data("kendoGrid");
var item = tsDataManager.gDataSource.get(id);
 
item.TimeStamp = tStamp;
                item.Close = aInfo.Last;
                item.Price = aInfo.Last;
                item.NetChange = aInfo.Net;
                item.AskPrice = aInfo.AskPrice;
                item.AskSize = aInfo.AskSize;
                item.BidPrice = aInfo.BidPrice;
                item.BidSize = aInfo.BidSize;
                item.TotalVolume = aInfo.Volume;
grid.refresh();
so it's basically the same thing.
I don't get what the advantage is here, especially with the editing of the rows.

Am i using it wrong?
MAGNUS
Top achievements
Rank 1
 answered on 03 May 2013
1 answer
68 views
How can I override the following, so my application scales correctly on Iphone 5?
<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">

Can I simply add the following statement to override, or do I have to pass this as some sort of parameter somewhere?
<meta name="viewport"
      content="initial-scale=1.0">
<meta name="viewport"
    content="width=320.1"/>

Regards,
Nicklas
Petyo
Telerik team
 answered on 03 May 2013
1 answer
2.1K+ views
Can someone please provide me with a few lines of code to get the value of a checkbox in a column in a Kendo Grid. Starting with this code:

columns.Bound(o => o.Resolved).ClientTemplate("&nbsp;&nbsp;&nbsp;&nbsp;<input type='checkbox' # if (Resolved) { #checked='checked'# } #/>").Title("Resolved").Width(60).Sortable(false);
                  
var data = $("#Appointments").data("kendoGrid").dataSource.data();

$.each(data, function (index, item)
{ trArray = { "Resolved": item.Resolved    <<--- This gives me the value IN THE MODEL --- I WANT WHAT THE USER HAS SELECTED!       }; });

Please don't send me a solution that hangs Visual Studio for an answer.

Thanks,
Eric
Top achievements
Rank 1
 answered on 03 May 2013
4 answers
222 views
Not sure if this is the right place for this but I've noticed on my site and the kendo demo page for tooltip that when you hover over a tooltip item the <title> element of the page is cleared and usually, but not always, restored when you mouse out. I assume this is to do with the code that removes the tooltip elements title to prevent the browsers default tooltip. 
Diane
Top achievements
Rank 1
 answered on 03 May 2013
3 answers
805 views
Let's say I have hierarchical data that I display in a treeview. It's possible that a particular node might have 1000 children and I don't want to display them all, so I'm toying with the idea of paging the nodes in a tree. I would show 10 children and if there are more, the user needs to click on the next/previous buttons to see them. I've got sql paging working but I can't get the treeview to do what I want. If I do this (first code snippet), my controller gets the proper node id and page id and it returns the correct page of results back. But then the treeview shows only the 1 page of children I just requested; the rest of the hierarchy (all the parents) is lost:
$("#btnNextPage").click(
   function () {
      var selectedNode = treeview.select();
      var selectedNodeID = treeview.dataItem(selectedNode).id;
      ds.read({
         LoopID: selectedNodeID,
         page: ds.page() + 1
         })
});

If I do the second code snippet, I can keep the hierarchy and my controller gets called, but I can't figure out how to pass in the page that I'm requesting.
$("#btnNextPage").click(function () {
   var selectedNode = treeview.select();
   var testnode = treeview.dataItem(selectedNode);
   testnode.loaded(false);
   testnode.load();
});

Any ideas?
jk
Top achievements
Rank 1
 answered on 03 May 2013
1 answer
321 views
Hi Guys,

In the past, Telerik Web UI has column called GridAttachmentColumn

Do we have this functionality in Kendo Ui grid

Thank you
Petur Subev
Telerik team
 answered on 03 May 2013
3 answers
194 views
I have a grid and have enabled the filter menu. I have removed the options "contains, equals to , and so on..." So all thats left is a kendoDropDownLIst with the available options for that particular column, and the Filter and Clear buttons. What Id like to do it, when the user opens the filter menu, that the dropDownList, will automaticallt open as well, so the user can select the appropriate value. I know its just saving one click, but the user wants that functionality... go figure...

Any ideas?
Atanas Korchev
Telerik team
 answered on 03 May 2013
8 answers
798 views
I have a checkbox father and 5 children, 3 of which are checked and not the other 2. How can I get the father as indeterminate form automatically?
Alex Gyoshev
Telerik team
 answered on 03 May 2013
3 answers
115 views
I have a remote data service that is set at the server side to pagesize 100.

I need to get 10000+  records back using a single query.

How do I do that?

I have tried using the add and splice methods on an observableArray object but nothing has worked. I have looked all over the place for an example or something close and have not seen anything.

example attempt from inside DataSource Object:

  schema: {
                data: function (response) {
                    //apply response to field that was in activeQuery
                    totalCount = response.totalCount;
// .set overwrites the returned set every time with the next page of data
                    assetViewModel.set("assets", response.assets);
// length is forever 0 with this
                    assetViewModel.assets_ds = response.assets.splice(assetViewModel.assets_ds.length,0,response.assets);
// tried using .add but this only works iterating through each of the 100 returned items in a loop - not performant
                    // we only have the first page of results from assetDataSource at this point
                  // we can process what we have so far and come back for next page 
                    locationsDataSource.read();
                    return response;
                },

if you need to see more we have to share files off forum thank you!

<update>
found allAssets = allAssets.concat(assetViewModel.assets.slice(0)); is slightly faster than a for loop through response to add items to allAssets

<update #2>
if you have a server that pages out data in small chunks the service calls will be the main slowdown - set expecations appropriately : )
Petur Subev
Telerik team
 answered on 03 May 2013
4 answers
1.4K+ views
Team, 

I would like to send only the changed fields from Kendo grid control to the server during the Update. By default Kendo is sending the entire record to the server even if one field is changed in that record. I would like to send only the updated fields rather than all fields.

How can i do it ?

Also, i would like to fire the update from an external button rather than the toolbar Save button. How to do it ?

Regards,
Bharani 
horo
Top achievements
Rank 1
 answered on 03 May 2013
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?