Telerik Forums
Kendo UI for jQuery Forum
2 answers
270 views
Hi!

We have a listView widget with endless scroll, bound to a datasource with a pagesize set to 10. We also use grouping on that datasource (one field, ascending).

The problem is that when new items are loaded in they form their own group, so we get many small groups of 10 items. We would like to ONLY group by the value in the group{field} and NOT group by pagesize. Any ideas?


- Example of how it is now and what we want to avoid -
Category (header)
Place (header)
Place (header)
Place (header)

- Example of what we want to achive -
Category (header)
Place (header)


Thanks!
Adrian
Top achievements
Rank 1
 answered on 25 Jul 2013
1 answer
131 views
Using this code I bind to a IDictionary<string,string> that has one item:

@(Html.Kendo().DropDownList()
      .Name("SelectedClientIdKendo")
      .HtmlAttributes(new { style = "width:200px" })
      .DataTextField("Key")
      .DataValueField("Value")
      .BindTo(Model.ClientList)
      )
The HTML looks ok that is rendered by the MVC wrapper, but the dropdownlist doesn't visually show any items in the list:

      <input id="SelectedClientIdKendo" name="SelectedClientIdKendo" style="width:200px" type="text" />
<
script>
    jQuery(function(){jQuery("#SelectedClientIdKendo").kendoDropDownList({"dataSource":{"2XXXXX":"2YYYYY"},"dataTextField":"Key","dataValueField":"Value"});});
</script>
                

Ian
Top achievements
Rank 2
 answered on 24 Jul 2013
2 answers
185 views
Hello,

I have the case where some of my editable data elements must be chosen from a drop-down list whose options are driven by external data. I have tried many different variations at accomplishing this with MVVM and have so far been unsuccessful. I've gotten edit and delete to work, as this simplified fiddle shows:

http://jsfiddle.net/D2maN/22/

but am stuck at the creation of new records. The problem is, I have no prior knowledge of the data in the dropdown so cannot hard-code default values in the schema. What I tried in that fiddle is creating a temporary, dummy default value to avoid the error, but now the problem is that if the user clicks "Add new record", and then just clicks "Update" right away (without changing the combobox), that dummy default gets saved (which in the real world breaks my application server-side because it's an invalid choice).

I have a lot of control over most aspects of this, so am open to any recommended approach for handling this case. I've looked through all of the demos a number of times but have been unable to locate one with this situation. The most promising theory I've though of so far is trying to find an event that I can use to programatically select the first element of the combobox in such a way as to actually update the viewModel right when the popup opens, but I can't seem to figure out how to do that. But, again, any way that works is fine with me...

Any thoughts or help would be greatly appreciated.

Thanks,
--Dan
Dan
Top achievements
Rank 1
 answered on 24 Jul 2013
1 answer
407 views
In the attached screenshot you can see that my financial data is date based. Sept, Dec and March (Quarters)

When I chart these 3 data points in a column chart, the chart adds Set,Oct,Nov,Dec,Jan,Feb,March.

I only want Sep,Dec and March to show and the columns to be then just really thick.

Is this possible?

Here's my chart:

Html.Kendo().Chart<AccountPerformance>(Model.Results)
                  .Name("chartPCT")
                  .Title("% Return")
                  .Legend(legend => legend.Visible(false))
                  .Series(series =>
                  series.Column(model => model.Metrics.Return)
                      .Name(Model.ColumnTitle)
                      .Labels(false))
                  .ValueAxis(axis => axis
                      .Numeric()
                      .Labels(labels => labels.Format("{0}%")))
                  .CategoryAxis(axis => axis
                      .Date()
                      .MajorGridLines(builder => builder.Visible(false))
                      .Categories(model => model.ObservationDate)
                      .Labels(labels => labels.Format("MMM")))
                  .SeriesDefaults(builder => builder.Column().NegativeColor("#BE2D55").Color("#C0BD7F"))
                  .Tooltip(tooltip => tooltip
                      .Visible(true)
                      .Color("white")
                      .Background("black")
                      .Format("{0:P2}")
                      .Template("#= value #")
                  )                                                        
                  .Render();
Iliana Dyankova
Telerik team
 answered on 24 Jul 2013
6 answers
597 views
With this data:
var fails = 
[
  { id: 0, name: 'zero', complex: { name: 'complex 0' } },
  { id: 1, name: 'one', complex: null }
];

And these columns:
var columns = 

  { title: "id", field: "id" },
  { title: "name", field: "name" },
  { title: "complex", field: "complex.name" }
];

This throws an exception and fails to render any data:
$("#fails").kendoGrid({
  dataSource: fails,
  columns: columns
});

JSBin demo here: http://jsbin.com/omuviw/3/edit
Cody
Top achievements
Rank 1
 answered on 24 Jul 2013
9 answers
424 views
I am trying to use pinned so that a simple window will have a fixed position. 

1) setting pinned to true seems to do nothing.
2) calling pin() on a window results in a javascript error. Uncaught TypeError: Object [object Object] has no method 'pin'

I am a newbie with Kendo.  Using 2013.1.514 downloaded today from Kendo.

$(document).ready(function( event ) { 

    var window = $("#add-comment");

    window.kendoWindow({
        width: "300px",
        height: "315px",
position: {
       top: 100,
       left: 100
   },        
title: "Add Comment",
modal: true,
visible: false,
pinned: true,
        actions: ["Maximize", "Close"],
    });

    $(".comment-button").on("click", function (e) {
   var kendoWindow = $("#add-comment").data("kendoWindow");
kendoWindow.center(); // no error, works
kendoWindow.open(); // no error, opens window
kendoWindow.pin(); // js exception
    });
Joe
Top achievements
Rank 1
 answered on 24 Jul 2013
4 answers
1.4K+ views
Hello,  I have selectable() enabled in my code but it still won't work, I want to be able to select a row and have additional data from the entry to be displayed below the table. I've tried a few different ways and can't seem to get it to work. My code is: 

@(Html.Kendo()
        .Grid<SiteLogEntry>()
        .Name("Logs")
        .EnableCustomBinding(true)
        .Columns(c =>
            {
                c.Bound(p => p.LogId).Title("Log ID");
                c.Bound(p => p.ServerName).Title("Server Name");
                c.Bound(p => p.DateEntered).Title("Date Entered").Format("{0:MM/dd/yyyy h:m:ss tt}").Width("150px");
                c.Bound(p => p.DateLogged).Title("Date Logged").Format("{0:MM/dd/yyyy h:m:ss tt}").Width("150px");
                c.Bound(p => p.SourcePage).Title("Source Page");
                c.Bound(p => p.SourceObject).Title("Source Object");
                c.Bound(p => p.Description).Title("Description");
                c.Bound(p => p.ErrorMessage).Title("Error Message");
                c.Bound(p => p.AdditionalData).Title("Additional Data");
                c.Bound(p => p.Severity).Title("Severity");
            })
            .Resizable(resize => resize.Columns(true))
            .Sortable(s => s.Enabled(true))
            .Selectable(s => s.Enabled(true).Mode(GridSelectionMode.Single).Type(GridSelectionType.Row))
            .Scrollable()
            
            .Filterable(f => f.Enabled(true)
        .Extra(false)
        .Operators(operators => operators
            .ForString(str => str.Clear()
                .StartsWith("Starts with")
                .IsEqualTo("Is equal to")
                .IsNotEqualTo("Is not equal to")
            ))
        )   
            .HtmlAttributes(new { style = "height: 400px; width: 1500px; align: right;" })
            .Pageable(p => p.Enabled(true).Refresh(true))
            .DataSource(ds => ds
                .Ajax()
                .PageSize(10)
                .Read(read => read
                    .Action("GetLog", "SiteLog").Data("times"))
                    .Sort(z => z.Add(t => t.DateEntered).Descending())
                    )
            )


Nothing really changes whenever I enable/disable selectable. My end goal is to have the description, message, and data only show a small portion of their value within the table, then on selection populate a div below the table with their full entries. I've checked a number of the kendo demos but none have helped solve this issue.  Thanks for any help with this issue. 
Tracey
Top achievements
Rank 1
 answered on 24 Jul 2013
3 answers
348 views
Is it possible to bind data from a viewmodel to data-columns? I tried the following to no avail.

<div data-role="grid"
                    data-sortable="true" data-editable="true"
                    data-columns="source: myColumns"
                    data-bind="source: entities"
                    data-row-template="rowTemplate"></div>



Cody
Top achievements
Rank 1
 answered on 24 Jul 2013
1 answer
89 views
Hi,

I thought Unobtrusive JavaScript event is more faster and a best practice over obtrusive . But in Kendo mobile, there is 'data-click' to attach event to element which seems to be  obtrusive event for me. Which way is the Best practice in Kendo mobile application and why?

Thanks,
Amrutha.

Petyo
Telerik team
 answered on 24 Jul 2013
6 answers
1.0K+ views
Hi,

I just spent the last couple of hours trying to get the ComboBox to work, but no luck so far. Here's the code breakdown:
Datasource:
var event_datasource = new kendo.data.DataSource({
    transport: {
        read: {
            url: "/event/datawidget",
            dataType: "json",
            type: "POST"
        },
        parameterMap: function(data) {
            return kendo.stringify(data);
        }
    },
    schema: {
        data: "data",
        total: "total",
        model: {
            id: "event_id",
            fields: {
                event_id: { type: "number" },
                description: { type: "string" }
            }
        }
    },
    sort: { field: "description", dir: "desc" }
    pageSize: 10,
    serverFiltering: true,
    serverPaging: true
});
ComboBox:
var event_widget = $("#event_id").kendoComboBox({
    dataTextField: "description",
    dataValueField: "event_id",
    filter: "contains",
    minLength: 2,
    dataSource: event_datasource,
    placeholder: "Select an event",
    value: '99',
    text: 'Some event',
    change : function (e) {
        if (this.value() && this.selectedIndex == -1)
            this.value(null); // clears the selection when an invalid selection was made
    },
      autoBind: false
}).data('kendoComboBox');
Problem:
The initial dataset that the datasource returns does not contain value 99 (Some Event).
When I set autoBind to false then the value and text are correctly shown upon initialization.

BUT, when I simply click the little arrow on the dropdown, the data is bound, the text "Some Event" disappears, and the shown text is set to 99 (aka the value).
Even when I don't actually select another item from the combobox, it keeps showing 99.

I've tried using the datasource filter to filter the selected event id, but I cannot unset this filter afterwards (or don't know how to do this properly; everything I tried just made things worse).

Can anyone tell me what I'm doing wrong here? Also, if someone has a clean and working solution to this, I recommend adding it to the documentation because more people seem to be struggling with this (based on similar threads in this forum).

Regards,
Rinck
Rinck
Top achievements
Rank 1
 answered on 24 Jul 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
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
Licensing
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
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?