Telerik Forums
Kendo UI for jQuery Forum
0 answers
139 views
Hello Telerik Team,

I have a grid with in-cell editing enabled and the grid is bound to my DepositDepartment model below.  Each DepositDepartment can optionally have a DepositDivision.  This DepositDivision can be chosen by the dropdown list I have on the grid.  The dropdown list gets its Text field from DepositDivision.Name and the Value field from DepositDivision.Id.  I also wire the Save event of the grid, so I can set DepositDivisionId property of the model.  I also need to set the DepositDivisionName property as it will be used for display when the cell comes out of the edit mode. 

public class DepositDepartment
{
    public int Id { get; set; }
    public string Name { get; set; }
    public int? DepositDivisionId { get; set; }
    public string DepositDivisionName { getset; }      
    /* other fields omitted */
}
 
public class DepositDivision
{
    public int Id { get; set; }
    public string Name { get; set; }
    /* other fields omitted */
}

With this setup, everything is working fine except for one specific scenario.  If I select "(None)" on the dropdown and get out of the edit cell.  The next time go into that cell and try to select some legit DepositDivision, when I come out of the cell, it won't have any effect (it will still show blank).  And when that happens, the Save event of the grid won't fire.  I've managed to narrow down the issue and found that in the code snippet below, it will somehow determine that the DepositDivisionId property is an observable object after I select the "(None)" option.  Specifically, when I select "(None)"  (which has empty string as its value) and get out of the edit cell, the grid fires the Save event properly and I set the DepositDivisionId property of my model to empty.  So far so good.  However, when I try to edit the dropdown again (without saving changes on the grid), the "this.widget.value()" will return null instead of empty.  The null value will cause _isObservableObject to be true.  And a little further down the value will be replaced by "value = source[idx];".  At this point the value variable will be the model corresponding to the grid row instead of just blank.  I think this is what causes the this.bindings.value.set(value) to fail and as a result, it won't trigger the Save event of the grid.

change: function () {
    var value = this.widget.value();
    var idx, length;
 
    var field = this.options.dataValueField || this.options.dataTextField;
 
    if (field) {
        var source,
            isObservableObject = this._valueIsObservableObject;
 
        if (this.bindings.source) {
            source = this.bindings.source.get();
        }
 
        if (value === "" && isObservableObject) {
            value = null;
        } else {
            if (!source || source instanceof kendo.data.DataSource) {
                source = this.widget.dataSource.view();
            }
 
            for (idx = 0, length = source.length; idx < length; idx++) {
                if (source[idx].get(field) == value) {
                    if (isObservableObject) {
                        value = source[idx];
                    } else {
                        value = source[idx].get(field);
                    }
                    break;
                }
            }
        }
    }
 
    this.bindings.value.set(value);
},

The sample project size is slightly large than the attachment limit but you can download it from the external link below.

http://dl.dropbox.com/u/18673670/TelerikSamples.zip

I know this is a very specific issue. So if you need further clarification, please feel free to let me know.

Thank you,
ben
Top achievements
Rank 1
 asked on 14 Aug 2012
2 answers
130 views
Hello everyone

Is there a way to set up a specific color to a serie? I am using a webservice.

I am bringing status, description and count... if I want put all that series with the estatus "disabled" in red...

I tried to work with my colors string array but the behavior it isn't standar
 series: [{ field: "count"}],
 seriesColors: ["#FF0000", "#0000FF", "#74DF00", "#DF3A01"],
Iliana Dyankova
Telerik team
 answered on 14 Aug 2012
1 answer
197 views
I want to change the standard select button to my own image.  How can I do this?
Alexander Valchev
Telerik team
 answered on 14 Aug 2012
1 answer
194 views
When TreeView is defined as static structure, or dataSource parameter is array type, expand method works correctly. But if items are bind by Kendo dataSource object the expand method works only if tree node was previously expanded "manually". This issue have consequence also for append method - if we use it to add item to "not-expanded" node it will destroy all child items for this node.

I've added simple example of this issue.

regards,
Piotr
Alex Gyoshev
Telerik team
 answered on 14 Aug 2012
1 answer
869 views
I want to create a custom toolbar. Here is my code:

toolbar:[{
    text: "Go to Add User Page",
    className: "k-grid-custom",
    imageClass: "k-add"
}],

function createUser(){
alert('Hello World');
}

I want to call the function named createUser when this button is clicked. How to make it possible?
dave
Top achievements
Rank 1
 answered on 14 Aug 2012
3 answers
234 views
Hallo,
it's me first step in Kendo Web and I have a big Problem. (Sorry for my bad englisch)
I have a APS.NET MVC 4 Projekt. 

In the @Code -Area I get the data with Linq. I convert it also to a Json-String

@Imports Newtonsoft.Json
@code

  ' -- die Teams einlesen
  Dim ccT = (From p2 In ctx.TeamSet Order By p2.TeamName Select p2.TeamName, p2.Id).ToList()
  Dim ccTeams = JsonConvert.SerializeObject(ccT , Formatting.None)
End Code

Then I have the HTML-Code for my KendoDropDownList

<input id="ecolor" value="1" />

And now my Script

<script>
    $(document).ready(function () {
 
        // create DropDownList from input HTML element
        $("#ecolor").kendoDropDownList({
            dataTextField: "TeamName",
            dataValueField: "Id",
            dataSource: '@ccTeams',
            index: 0,
            change: onChange2
        });
 
        var color2 = $("#ecolor").data("kendoDropDownList");
        function onChange2() {
            var value = $("#ecolor").val();
            alert(value)
        }
    });
 
</script>

That dosn't work. The DropDownBox is empty. What is wrong? 
Thanks in advance 

Roland




John DeVight
Top achievements
Rank 1
 answered on 14 Aug 2012
2 answers
225 views
Hello
when use Ajax binding sorting and filtering parameter where not correctly passed on server handler:
I usethe following code in my MVC view:
<%:
 
Html.Kendo().Grid<Totalcom.XBase.Biz.Base.Models.Elements.Element>()
.Name("Grid").Columns(columns =>
{
     
    columns.Bound(p => p.IsActive).Title("Attivo");
    columns.Bound(p => p.Name);
    columns.Bound(p => p.Key);
     
})
.DataSource(dataSource => dataSource
        .Ajax() // Specify that the data source is of ajax type
        .Model( model =>
            {
            model.Id (x => x.Key);
            model.Field(x => x.IsActive);
            model.Field(x => x.Name);
            model.Field(x => x.Key);
            })
          .Sort(sort => sort
              .Add(x => x.Name)) 
        .Read(read => read.Action("GetChildren", "Documents", new { Area = "CMS", Id = Model.Key, ApplicationKey = Html.GetSessionInfo().ApplicationKey}))  
         
        )
.Sortable()
.Pageable()%>

and when I try to sort the get query is the following:

/CMS/Documents/GetChildren/xx?&take=10&skip=0&page=1&pageSize=10&sort%5B0%5D%5Bfield%5D=Name&sort%5B0%5D%5Bdir%5D=desc

it seems that the sort parameter is not correctly encoded. on my controller the code is the following :

public ActionResult GetChildren([DataSourceRequest]DataSourceRequest request)
      {
         ...
          DataSourceResult result = children.ToDataSourceResult(request);
          return Json(result, JsonRequestBehavior.AllowGet);
      }


request.Sort and request.filter are NULL
Any suggestion?
Lorenzo
Top achievements
Rank 2
 answered on 14 Aug 2012
2 answers
240 views
I would like to implement an outlook style panel bar similar to what is implemented in the Telerik ASP.NET Ajax Panel Bar demo here: 
http://demos.telerik.com/aspnet-ajax/panelbar/examples/applicationscenarios/outlooknavigation/defaultcs.aspx 

Is this possible with the KendoUI panel bar?
David
Top achievements
Rank 1
 answered on 14 Aug 2012
3 answers
237 views
I have the following code.

$(

'span[data-class=ModalLink]').click(openmodal);
$('a[data-class=ModalLink]').click(openmodal);

    $('span[data-class=ModalLink]').click(openmodal);
    $('a[data-class=ModalLink]').click(openmodal);
    function openmodal(event) {
        event.preventDefault();
        var contentUrl = $(this).attr("data-content");
        if (!contentUrl) {
            contentUrl = $(this).attr("href");
        }
        if (contentUrl) {
            var dialog = $("#modalwindow");
            dialog.kendoWindow({
                modal: true,
                title: $(this).attr("data-title"),
                actions: ["Close"],
                draggable: $(this).attr("data-draggable"),
                resizable: $(this).attr("data-resizable"),
                height: $(this).attr("data-height"),
                width: $(this).attr("data-width"),
                content: contentUrl
            });
            dialog.data("kendoWindow").center();
            dialog.data("kendoWindow").open();
        }
        else {
            alert("The URL to populate the modal window is missing.");
        }
I want the window configuration value like width, height etc. to change every time I open the window. It is not happening. I can see in the debugger that new values are there window is not updating the values except content. How can do this?
 
Alex Gyoshev
Telerik team
 answered on 14 Aug 2012
6 answers
241 views
Hi guys,

Been working with the new Action Sheet control and it's been really great! Just struggling with one thing at the moment.

I'm trying to open a Kendo ActionSheet control in javascript with the following sort of approach:

$("#MyTestActionSheet").data("kendoActionSheet").open();

I assume the open method (Which I found in the documentation) is correct but i'm not accessing the Kendo data object correctly to call it. I've tried using "kendoActionSheet" (based on how it is done with other controls) but It doesn't seem to exist and I'm struggling to find documentation on how to do it.

Am I missing something?

Thanks in advance,

Rob

Iliana Dyankova
Telerik team
 answered on 14 Aug 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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?