Telerik Forums
Kendo UI for jQuery Forum
0 answers
189 views
Hi,

I have already created a new kendo.data.dataSource with success, and I am able to bind it to the KendoUI Grid on my page.

But when I try to dataSource.insert(0, [a : "b"]); it removes the data that was there previously.

My example code follows:
var tempSource = new kendo.data.DataSource({
     data: [{"ID":1,"Name":"Cliente 1","NameID":"1 - Cliente 1"},{"ID":2,"Name":"Cliente 2","NameID":"2 - Cliente 2"}]
});

This is how I'm binding to the grid:
$("#association-grid").kendoGrid(
{
                    height: 99,
                    columns:
                    [
                        {
                            field: "ID",
                            title: "ID"
                        },
                        {
                            field: "Name",
                            title: "Name"
                        },
                        {
                            field: "NameID",
                            title: "NameID"
                        }
                    ],
                    dataSource: tempSource
                });

This is how I add a new item:
tempSource.insert(0, { ID: "John Smith", Name: "Product Description", NameID: "123 1st Street" });

If I perform the add before binding the data to the Grid, I lose the first two items that were originally on the dataSource object.

In summary:
I have a pre-created dataSource binded to a Grid. I want to be able to add a new item to the dataSource, and then refresh the Grid so that the new item appears.

Thanks,

LCG
Luis
Top achievements
Rank 1
 asked on 23 May 2012
3 answers
108 views
I have a grid using a data source with serverAggregates and serverFiltering set to false. The first time the remote data endpoint is queried, everything is fine. However, after the data comes back, I manually set some aggregates. Then, on a subsequent call to dataSource.read(), all of the aggregates are sent to the server in the query string. I'm not sure what to do, but this seems like a bug and is causing me problems in that I actually reach the query string length limit.

A sample url looks like this, decoded:

http://localhost:57135/ReportData?filter[logic]=and&filter[filters][0][field]=IsContractor&filter[filters][0][operator]=eq&filter[filters][0][value]=false&aggregate[0][field]=May_01&aggregate[0][aggregate]=sum&aggregate[1][field]=May_02&aggregate[1][aggregate]=sum&aggregate[2][field]=May_03&aggregate[2][aggregate]=sum&aggregate[3][field]=May_04&aggregate[3][aggregate]=sum&aggregate[4][field]=May_05&aggregate[4][aggregate]=sum&aggregate[5][field]=May_06&aggregate[5][aggregate]=sum&aggregate[6][field]=May_07&aggregate[6][aggregate]=sum&aggregate[7][field]=May_08&aggregate[7][aggregate]=sum&aggregate[8][field]=May_09&aggregate[8][aggregate]=sum&aggregate[9][field]=May_10&aggregate[9][aggregate]=sum&aggregate[10][field]=May_11&aggregate[10][aggregate]=sum&aggregate[11][field]=May_12&aggregate[11][aggregate]=sum&aggregate[12][field]=May_13&aggregate[12][aggregate]=sum&aggregate[13][field]=May_14&aggregate[13][aggregate]=sum&aggregate[14][field]=May_15&aggregate[14][aggregate]=sum&aggregate[15][field]=May_16&aggregate[15][aggregate]=sum&aggregate[16][field]=May_17&aggregate[16][aggregate]=sum&aggregate[17][field]=May_18&aggregate[17][aggregate]=sum&aggregate[18][field]=Total&aggregate[18][aggregate]=sum&aggregate[19][field]=Difference&aggregate[19][aggregate]=sum

The columns listed are in my data source's aggregates, but they shouldn't be sent to the server.
Brian Vallelunga
Top achievements
Rank 1
 answered on 23 May 2012
5 answers
561 views
How do I update a piece of data in an existing dataset? The following is the code I have for updating and adding to an existing dataset, the add works correctly, but how do I make the update work?

function AddEntityToDataSource(entityset, entity) {
 
    var ds = GetDataSource(entityset);
 
    ds.add(entity);   
     
}
 
function UpdateEntityToDataSource(entityset, entity) {
 
    var ds = GetDataSource(entityset);
 
    entity = ds.get(entity.id);
 
}


John
Top achievements
Rank 1
 answered on 23 May 2012
2 answers
89 views
It's a list of items, the calendar is bound to a date value on the "SelectedItem"

So when selected item changes I want to show the value in the calendar.

However what's happening is that the calendar just keeps animating (rather choppy) back to may 2012 over and over with no selected dates.

This is the date value I'm binding to "2013-04-01T00:00:00"

Here's the markup
<li>Starts: <span data-role="calendar" data-bind="value: selectedBlock.data.StartDate"></span></li>

ideally i'd like no animation, and just want to visualize the dates
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 23 May 2012
1 answer
272 views
Is there is any way that I can show all my validation messages on a window (or a dialog). My client don't want the messages on the right of each input boxes?
Iliana Dyankova
Telerik team
 answered on 23 May 2012
0 answers
160 views
hi,
i am able to load the grid from the database.i have an image field in my database,i want to display image in the grid.now it is showing undefined in the image field.can u tell me how to insert an image.
and also i want to use check box,radio button,combo box and link.what is the "type" i have to give for these fields.
charan
Top achievements
Rank 1
 asked on 23 May 2012
1 answer
358 views
I have a web service that returns me results as this data structure.
public class LoadSearchingReturn
{
    [DataMember]
    public IEnumerable<Results> SearchingResults { get; set; }
    [DataMember]
    public IEnumerable<string> Errors {get;set;}
    [DataMember]
    public int TotalResults { get; set; }
}

TheSearchingResults is what displays in my grid and I use the Total Results inside my schema like:
dataSource: {
    schema: {
        data: "d.SearchingResults",
        total: function (data) {
            return data.d.TotalResults;
        }
    },

So, my question...How do i access that Errors collection and display that to the user?
Alexander Valchev
Telerik team
 answered on 23 May 2012
0 answers
238 views
I'm trying to bind and image to the background of a div but having trouble due to the need to add 'url()' to the image.  In the example below if selectedPhoto is just the path to the file "/image/somefile.jpg" then it doesn't work.  If selectedPhoto is "url('/image/somefile.jpg')" then it works.  Is there a way to add in url() in the binding around the variable selectedPhoto without having to including it in the value of the variable?

data-bind="style: { backgroundImage:  selectedPhoto  }"

I cross posted this under an older thread but wasn't sure if I would get a response.

http://www.kendoui.com/forums/framework/mvvm/problem-in-binding-style-in-template.aspx

Thanks,
Brad
Brad Sumner
Top achievements
Rank 1
 asked on 23 May 2012
2 answers
195 views
Hi,

How can I add command columns to a grid that I defined from an HTML table?

The only way I have seen to add a command column is through the example code, where the command columns are included in the column definition.

Since I am defining from an HTML table, I have not needed to define the column set in Javascript, so I am unclear how to add a command column (edit / delete) in this case.

Thanks
TK
Top achievements
Rank 1
 answered on 23 May 2012
2 answers
111 views
Hi guys,

I'm having an issue where i have a switch control (Based on a input tag with type set to checkbox) embedded in an item in a list view. 

It works perfectly everywhere I test except on android 2.3.4 devices where it does not appear at all. (I have tested on a Samsung Galaxy S II and a Sony Xperia Arc S and it does not work on either phone)

I'd like to note that it does work on these devices when it is outside of a list view (ul, li tags) but the minute I place it inside one it disappears.

I use the following code in a view:

<ul data-role="listview" data-style="inset" data-type="group">
        <li>
            Africa
            <ul>
                <li data-icon="toprated"><input name="MyCheckBox" id="MyCheckBox" type="checkbox" data-role="switch"/></li>
            </ul>
        </li>
</ul>


Thanks,

Rob
Grant
Top achievements
Rank 1
 answered on 23 May 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
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
ScrollView
Switch
TextArea
BulletChart
Licensing
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
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?