Telerik Forums
Kendo UI for jQuery Forum
1 answer
201 views
I have a grid which I need to refresh after a new record has been added or an existing record is amended.

If I call the setDataSource function the datasource is read and the grid is populated with fresh data.  Unfortunately the column sort will then no longer work.  It does work on first read of the data.

If I destroy the grid and recreate it the sortable columns continue to work, but then all button click handlers run multiple times, eg. second grid create they run 2x, third grid create 3x etc.

What is the correct way to refresh a grid without either breaking the sortable option or getting multiple registrations of the command handlers?

*** UPDATE ***
When the sort breaks I have found that calling setDataSource again fixes it!?
Here is setDataSource that breaks sortable columns:
$(
"#dvTargetGrid").data("kendoGrid").setDataSource(wwit.targets.getDataSource());

Here is the grid:

try { $("#dvTargetGrid").data("kendoGrid").destroy(); }
        catch (e) { }
        $("#dvTargetGrid").empty();
        $("#dvTargetGrid").kendoGrid({
            columns: [
                { field: "Year", title: "Year", width: 45 },
                { field: "Month", title: "Month", width: 50 },
                { field: "TargetType", title: "Target Type" },
                { field: "MeasurementType", title: "Measure", width: 70 },
                { field: "Target", title: "Target" },
                { field: "TargetItem", title: "TargetItem" },
                { command: {
                    name: "EditT", text: "Edit",
                    click: wwit.targets.editTarget,
                    imageClass: "k-edit",
                    className: "k-grid-edit",
                    iconClass: "k-icon"
                }, width: 85
                },
                { command: {
                    name: "DeleteT", text: "Delete",
                    click: wwit.targets.deleteTarget,
                    imageClass: "k-delete",
                    className: "k-grid-delete",
                    iconClass: "k-icon"
                }, width: 90
                }],
            sortable: true
        });
Rosen
Telerik team
 answered on 18 Mar 2013
2 answers
99 views
Hello all,

I have updated our application to use Kendo version 2013.1.226 beta that you released. It seems that the new update has broken the Grid BatchEditing feature. In particular, when I click on "Save Changes" button I get the following error:

GET http://localhost:5818/Settings/Editing_Update?models%5B0%5D%5BId%5D=f452ada…e%5D=Sir+de+test+trtrtrrtrtrtrt3434343434&models%5B0%5D%5BDecimalValue%5D= 404 (Not Found)
Both grid and server side setup are made:

Cshtml page

.DataSource(dataSource => dataSource
                .Ajax()
                .Batch(true)
                .ServerOperation(false)
                .Model(model => { model.Id(s => s.Id); model.Field(s => s.Name).Editable(false); })
                .Read("Editing_Read", "Settings", new { type = MF.Model.SettingType.Decimal })
                .Update("Editing_Update", "Settings")
                .Create("Editing_Create", "Settings")
            )

Controller code:

[AcceptVerbs(HttpVerbs.Post)]
        public ActionResult Editing_Update([DataSourceRequest] DataSourceRequest request, [Bind(Prefix ="models")]IEnumerable<Entity> settings)
        {
           //code
        }

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult Editing_Create([DataSourceRequest] DataSourceRequest request, [Bind(Prefix = "models")]IEnumerable<Entity> products)
        {
           //code
        }

The above code used to work before making the upgrade to Kendo version 2013.1.226 beta.

Can you please check this behavior.


Thank you in advance!

Best regards,
Razvan
Razvan
Top achievements
Rank 1
 answered on 17 Mar 2013
4 answers
596 views
Is there any easy way to get the value of the items per page drop down that shows at the bottom of the grid whenever it changes? I'd like to store the changed value in localStorage so the user doesn't have to re-pick the value every time they load the page.
Troy
Top achievements
Rank 1
 answered on 16 Mar 2013
1 answer
76 views
Title says it ^

I want to use grids much like in the web examples: http://demos.kendoui.com/web/grid/index.html  only using Kendo Mobile, what is the right way to achieve this?
Yavor Georgiev
Telerik team
 answered on 16 Mar 2013
2 answers
472 views
From my backend it generate a treeview using a ul/li construction:

<ul id="treeView">
        <li data-uid="8f04cb75-1a2a-4c9b-95c6-4a44d963505c" data-parent="">Root
         <ul>        
<li data-uid="64ca06a9-72b3-4444-b951-f46e0378b26b" data-parent="8f04cb75-1a2a-4c9b-95c6-4a44d963505c" ">1.1
            <ul
        </li>
</ul>

However, when I take a look when after init the kendoui treeview, the data-uid's are all randomly recreated.

From there, I took a different approach and used the id attribute for the identifiying the node. However, when a node is drag & dropped the resulting node does not contain the id. Also when custom attributes are used for this purposes the Id of the node is gone.

This leave the treeview completely useless, since postingback to the server is impossible.

So the question is, howto preserve the id's??
David
Top achievements
Rank 1
 answered on 16 Mar 2013
5 answers
208 views
I am trying to have a editable grid, minimizing network traffic. The grid is only editied 1/20 page loads.
My data model is like this:
Items: ItemdID, ItemName
ItemSerials: ItemSerialID, ItemSerial, ItemID
Units: UnitID, ItemID, Unit
ItemRental: ItemRentalID, ItemID, ItemSerialID, UnitID, Quantity

There may be multiples serials, and Units for each Item.
The data comes from the backend as a Join: with the fields from all 4 tables.
I would like the grid to Show:
ItemName, SerialNumber, Units, Quantity
But need to save an ItemRental row.

Initially I had the table with an ItemID column, using a template which called a lookup function (getName(itemid)) which displayed the ItemName. In order for this to work, I had to pull the entire Items table into memory, so that the lookup function could use it.

The ItemSerials table is worse, as it has 100,000 serrals, but only a handful are applicable to each item. So in order to show SerialNumber, but have ItemSerialID as my value, I have to pull the whole table into memory too. Yes, for loading the drop-down-list I can use the selected item, and filter the fetched serials based on that, but in order to show SerialNumber, but have ItemSerialID  as my value field using template which alls function like the item name (getSerial(serialid), I need to have all in memory.

I would like to handle this by having all fields as part of my data model, then  only showing four mentioned, and hiding the Id columns. My drop downlist for ItemName woulld be on the item name field would then transport.read in all the items on creation of the first editor (dd list). The DDL would read in the whole Items table, be the editor for the ItemName column, but I would also need it to set the value in the ItemID column:  
I can get the itemID in my 'change' function for the DDL,  like this: e.sender.options.dataSource[e.sender.selectedIndex].ItemID, but then what do I do with it? How do I set the value of the hidden ItemID column?

Then another tricky part is when the Item is selected, I then need to cascade the DDL for the SerialNumber column based on ItemID, not on ItemName....

Is there a better way to solve this problem, and avoid pulling unecessary data into memory? I need to show employer bandwidth test in order to buy.

Thanks,
~S
Shea
Top achievements
Rank 1
 answered on 15 Mar 2013
0 answers
93 views
Hi guys,

1. Is there a way to adjust divs (height specifically) to the size of different mobile platforms using kendo? (perhaps a quicker way than with native js?) or with a css class maybe?

2. Essentially when the app starts up i want the divs to already be in the correct sizes. if I adjust programmatically, when is the best time to call the function? before the call to kendo? right after? the phonegap ready event? 


Gal
Top achievements
Rank 1
 asked on 15 Mar 2013
1 answer
157 views
Hi,

we want to use the grid with virtual scrolling enabled and aggregates in footers and group-footers. Our DataSource is a local Javascript array.

The Problem is:
The aggregate values change while scrolling down the grid. The values reflect the content of the visible selection. 

We want to freeze these aggregate values so they are the same as virtual scrolling would be disabled.

Is this possible?

The only solution that comes to my mind is that we fake server-side aggregates like in this example: http://jsfiddle.net/knWcJ/74/

But is there a simpler way?

Thanks for helping!

Tilo
Alexander Valchev
Telerik team
 answered on 15 Mar 2013
2 answers
106 views
Hey folks,

I was wondering if you might be able to explain why templates are behaving the way they are in our application since I'm a little lost on what is going wrong.  Using v2013.1.307, we are using the Routing component as well as Kendo Templates to create a SPA interface.  

With this in mind, we load the main views using a listview and templated li's, which works like a charm.  Everything loads and template data and inline script works as intended (alert is fired):

<li class="clearfix">
    <a href="\#/project/#: data.Id #">
        #
        var leadPhoto = data.parent().parent().photoFileNameForLead(data);
        alert("pl");
        if (leadPhoto) {#
            <img class="team-lead" data-bind="attr: {src: photoFileNameForLead}" />
        #} else {#
             <div class="team-lead icon-user">No Lead</div>
        #}#
        <header>
            ...
        </header>
    </a>
</li>
However, when clicking into the details for an item, the same exact template code appears as inline text within the html, so the template never gets picked up:

<article>
    <div class="resource-info">
        ...
    </div>
    <div class="resource-projects">
        <h3>Current Projects</h3>       
        <ul data-bind="source: getProjectsForActiveResource" data-template="resource-details-project"></ul>
        #
        alert("new resource");
        var leadPhoto = data.parent().parent().activeResource;       
        if (leadPhoto) {#
            <img class="team-lead" data-bind="attr: {src: photoFileNameForLead}" />
        #} else {#
             <div class="team-lead icon-user">No Lead</div>
        #}#
    </div>
    <button data-bind="click: saveActiveResource" class="save-button">Save</button>
</article>
So rather than seeing a distinct photo/decorate div and getting an alert, this just gets written directly into the document.

Is there a different behavior that we need to use in order to get these inline templates working in different scenarios?  The only difference I can see is that the second snippet is being loaded via the router > return a view, meanwhile the original <li> is being loaded by a Kendo component as individual templated items.  

Thanks!
-Evan
Evan Hutnick
Top achievements
Rank 1
 answered on 15 Mar 2013
1 answer
185 views
When using IE the resizable mouse cursor is not showing on my column headers because I also have filtering turned on.  In Chrome this is not a problem.

I went into kendo.common.min.css and set the .k-grid .k-resize-handle z-index to 99 to fix the problem.
Alexander Valchev
Telerik team
 answered on 15 Mar 2013
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
Drag and Drop
Application
Map
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
DropDownTree
ListBox
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
Styling
ColorPicker
Pager
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
Licensing
PivotGridV2
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
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
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?