Telerik Forums
Kendo UI for jQuery Forum
1 answer
185 views
Dear sir,
          i'm using kendo ui multiselect with MVVM and 
at the first time i'll set the value externally via button click its working fine
but i'm afraid when i'd typed value wrongly which is not in data source then i'd set the value which is not fired
but the value is updated in view Modal but data not shown in Widget 
please clarify me where i'm wrong
i'd attached the zip file which contains work around and the video for this error

thanks in advance,
santhosh.B
Georgi Krustev
Telerik team
 answered on 16 Dec 2014
1 answer
376 views
I am rolling out a grid to allow end users to update database values.  It needs to be able to sort, group, and filter, which I've never been able to get to work with custom editor templates so I'm using the "values" property to initialize the Foreign Key columns as dropdown lists.  I am using a popup editor template, not in line grid editing.  The grid is bound to an external datasource using a kendoDataSource in the viewModel.

As long as there is data being passed to a field, everything works great.  I can create/edit things just fine and dandy.  The issue is some of these columns can be null, and if a value is null when I popup the editor and change the value from null to something, the binding doesn't work and the new value doesn't update the view model and doesn't get passed to the "update" function.  (Note: this doesn't seem to be specific to the editor popup, when I change things to edit in-line the same issue occurs.)

For example:  I have an "AssignedDrafter" field. 

It is initialized in datasource.schema.model.fields like so:

AssignedDrafter: { type: "number", nullable: true }


It is in kendoGrid.columns like so:

field: "AssignedDrafter", title: "Assigned Drafter", width: 175, values: ARS.kendoHelpers.makeValues(amplify.store(ARS.ls.config.Types.ActiveEmployees), "FullName", "EmployeeID")

I am using amplifyjs to store local data since the end users can be at remote sites where internet is only accessable over a high latency satellite hop, and I have a function which converts the Json data being stored into an appropriate array of { text: FullName, value: EmployeeID } objects.

I bind to the data in the popup editor like so:
<div class="col-xs-6">
                   <div class="col-xs-4">
                       <label for="AssignedDrafter" class="labelCenter">Assigned Drafter</label>
                       <span class="k-invalid-msg" data-for="AssignedDrafter" />
                   </div>
                   <div class="col-xs-8">
                       <input name="AssignedDrafter"
                              data-text-field="text"
                              data-value-field="value"
                              data-bind="value:AssignedDrafter, source: activeEmployeeValues"
                              data-role="dropdownlist"
                              class="maxwidth"/>
                   </div>
               </div>

On Create, Delete, and Read everything works as I would expect, even if the AssignedDrafter is null.  The issue is when I am editing an existing record and the value is null.  The dropdownlist appears as normal, with the first option displayed.  I select a different option and click Update and the popup closes, but no update occurs.  I investigated further and it appears that the update event doesn't fire.  OK, so I went in and edited a text field on the record and then updated the AssignedDrafter field and then set a breakpoint to see what was getting passed back to the controller.  The edit for the text field came through, but the edit for the AssingedDrafter field did not, the value being passed was "null".

The weirder thing is that if I go into the database and manually insert a value, then come back to the kendo grid and update the AssignedDrafter field to a different person, the update goes through just fine.  

I have several other drop down lists on this grid that all behave exactly the same.

It appears that the binding doesn't work if the value being passed is null.  I've got a workaround in place where I pass a placeholder value ("-1") for nulls, but it is a hack and uncessearily complicates the code quite a bit.  It seems like maybe I am doing something wrong?  Has anyone successfully gotten foreign key columns to work with null values?
Georgi Krustev
Telerik team
 answered on 16 Dec 2014
2 answers
251 views
I'm trying to figure out a way to present a dropdown list of commands on a grid row when it isn't in edit mode. I need to make sure that this dropdown list is bindable to data from my model. Is this something I could do with a template field instead?

For instance I have a grid that has a couple of columnns, id and name. I'd like to create a third column that has a list of all the names of the grid and when the user selects one of the names, I'd like to use that to reorder the grid based on the selection. I'm going to use this style to reorder grid rows instead of using drag/drop.
Richard
Top achievements
Rank 1
 answered on 16 Dec 2014
5 answers
208 views
Should I be able to attach a click event to an item in the template for a scrollview?

No matter how simplified I make the template,  there is  always an error of "undefined is not a function" arises if I put a click event on any html item in the scrollview template. But the function is definitely in the view model.  In fact of course putting a fake click method to invoke in the    template generates the same error, so it leads me to think that the template is not bound to the viewModel.

<div data-role="view"
            data-title="debug"
            data-model="app.friendsService.viewModel"
            data-stretch="true">        
                    <div 
                    id="toddlersScrollview"
                    data-role="scrollview" 
                    data-items-per-page="6"     
                    data-bind="source:friendsDS" 
                    data-template="allfriends-template"
                    data-enable-pager="false"
                    style="height:200px;">
                    </div>
                </div>

                </div>
                
                <script type="text/x-kendo-template" id="allfriends-template">                  
           <div data-bind="click:onfriendClick"></div>
                </script>
             </div>     
</div>




Viewmodel snippet:

function (global) {
    var friendsViewModel,
        app = global.app = global.app || {};
    friendsViewModel = kendo.data.ObservableObject.extend({ 
        roomid:null,
        childid:null,
        fname:null,
        mname:null,
        friendsDS:null,
        onfriendClick: function(e) {
            console.log("something");
        },
    friendsDS: new kendo.data.DataSource({
            transport: {
                read: {
                     url: "http://someurl.com/v1/room/param/children",
                    dataType: "json",
                    data: function() {
                       var roomid =  app.friendsService.viewModel.get("roomid")
                       return {roomid: roomid};
                    },
                    type: "GET"
                },
                update: {
                    url: "http://acorn.xander.com/api/rooms",
                    type: "PUT"}
            },
            schema: {
                model: { "id":"id",
                    fields: {
                        id: { type: "number" },
                        fname: { type: "string" },
                        mname: { type: "string" },
                        lname: { type: "string" }
                    }
                }
            }
        })
    });       
        app.friendsService = {
        viewModel: new friendsViewModel()
    };

})(window);

Alex
Top achievements
Rank 1
 answered on 16 Dec 2014
1 answer
209 views
Hi,

i am using the excel export feature, but in the toolbar the wrong icon is displayed.

Is this a bug, or do I have to use an extra css file?

regards


@(Html.Kendo().Grid<NursingHomeStock.Models.ResidentViewModel>()
    .Name("AvailablePlaceTypesGrid")
    .Columns(columns =>
    {
        columns.Bound(rvm => rvm.FirstName).Filterable(f => f.Extra(false).Operators(o => o.ForString(fs => fs.Clear().Contains(GlobalResources.Contains))));
        columns.Bound(rvm => rvm.LastName).Filterable(f => f.Extra(false).Operators(o => o.ForString(fs => fs.Clear().Contains(GlobalResources.Contains))));
        columns.Bound(rvm => rvm.Sex)
            .ClientTemplate("#if (Sex == 1) { #" + GlobalResources.Male +
                "#} else if (Sex == 2) { #" + GlobalResources.Female +
                "# } #")
            .EditorTemplateName("DropDownListSex").Filterable(f => f.Extra(false).Operators(o => o.ForString(fs => fs.Clear().Contains(GlobalResources.Contains))));
        columns.Bound(rvm => rvm.BirthDate).Format("{0:dd.MM.yyyy}").EditorTemplateName("Date").Filterable(f => f.Extra(false));
        columns.Bound(rvm => rvm.SocialSecurityNumber).Filterable(f => f.Extra(false).Operators(o => o.ForString(fs => fs.Clear().Contains(GlobalResources.Contains))));
        columns.Bound(rvm => rvm.Comment).Filterable(f => f.Extra(false).Operators(o => o.ForString(fs => fs.Clear().Contains(GlobalResources.Contains))));
        columns.Command(command => command.Destroy().Text(GlobalResources.Delete));
    })
    .ToolBar(toolbar =>
    {
        toolbar.Create().Text(GlobalResources.Create);
        toolbar.Save().CancelText(GlobalResources.Cancel).SaveText(GlobalResources.Save);
        toolbar.Excel().Text(GlobalResources.ExcelExport);
    })
    .Editable(editable => editable.Mode(GridEditMode.InCell))
    .Pageable(pageable => pageable
        .Refresh(true)
        .PageSizes(new []{ 5, 10, 20, 50, 100})
        .ButtonCount(5))
    // TODO: set default filter operator to [contains]
    .Filterable()
    .Navigatable() // Tabulator Support
    .Sortable()
    .ClientDetailTemplateId("ResidenceGrid")
    .DataSource(dataSource => dataSource
        .Ajax()
        .Batch(true)
        .Events(events => events
            .Error("App.errorHandler")
        )
        .Model(model =>
        {
            model.Id(e => e.Id);
            model.Field(e => e.Id).DefaultValue(Guid.NewGuid());
        })
        .Sort(sort => sort.Add("LastName").Ascending())
        .Read(read => read.Action("ReadResident", "Resident", new { ViewBag.nursingHomeId }))
        .Update(update => update.Action("UpdateResident", "Resident"))
        .Create(create => create.Action("CreateResident", "Resident", new { ViewBag.nursingHomeId }))
        .Destroy(destroy => destroy.Action("DestroyResident", "Resident"))
    )
    .Events(events => events.DataBound("App.Resident.dataBoundResidenceGrid"))
)
Dimiter Madjarov
Telerik team
 answered on 16 Dec 2014
3 answers
1.1K+ views
I'm embedding an kendo.ui.editor in a UIWebView in an iOS application using html, css and javascript hosted on the device itself.

I am unable to force the height of my text area below 150px.
My html is this:
<body>
<div>
<textarea id="editor" style="width:100px;height:100px;">
</textarea>
<script>
$(document).ready(function() {
    $("#editor").kendoEditor( { encoded: false } ); } );
</script>
</div>
</body>
The above yield a text area which is 100px wide, but 150px high.
Controlling the width is no problem, and the height is also fine when giving a value above 150px.
The size of the UIWebView containing the editor is 500px wide and 250px high, but this size does not seem to affect the 150px limit.

I have tried various tweaks to the css (height, min-height, …), but to no avail…
Is there somewhere a limit on how low the height of an text area can go ?  Somehwere in the kendo css that I haven't found / browser defaults / something completely different ?
Kiril Nikolov
Telerik team
 answered on 16 Dec 2014
1 answer
79 views
Exporting grid data as pdf is fine...
Can i export grid data as excel without loading data from db.. I mean While exporting as excel is ajax need ? 
Kiril Nikolov
Telerik team
 answered on 16 Dec 2014
8 answers
476 views

Fiddle with error:
http://dojo.telerik.com/uGaqa/3

1) Run the fiddle in latest Google Chrome (for now it is 39.0.2171.71)
2) Click on calendar icon. Datepicker is shown.
3) Click on month year ("December 2014") in the datepicker title. The title changes to year "2014".
4) Click on year in the title ("2014"). Check the datepicker view.

Actual result:
There's javascript error in console: Uncaught TypeError: Cannot read property 'left' of undefined;
Second datepicker window is wrongly shown;
Second datepicker window doesn't disappear even after toggling the datepicker;

Expected result: Date picker changes its view to year selection; no errors in console; datepicker's view should not be broken.

Georgi Krustev
Telerik team
 answered on 16 Dec 2014
1 answer
348 views
In this example I have an AngularJS sortable that contains three divs. My objective is to obtain the id and the text of the div that was clicked, however the click event is not triggered. What's wrong with this code?


This is the javascript:

    var app = angular.module("app", [ "kendo.directives" ]);
    
   
  app.directive('dir2', function() {

    var directive = {};

         directive.restrict = 'EA';

         directive.template = '<div kendo-sortable="list" id="listid"></div>';

         directive.link = function(scope, element, attrs) {

        scope.$on("kendoWidgetCreated", function(event, widget){
 
              if (widget === scope.list) {
                         $('#listid').append ( '<div id="div1" class="item">11111111</div>');  
                         $('#listid').append ( '<div id="div2" class="item">22222222</div>');
                         $('#listid').append ( '<div id="div3" class="item">33333333</div>');
                 }

           });


          $('.item').on( "click", function( event ){

                         alert('clicked');
                         console.log(event);
          });


        };

        return directive;
  });
Alexander Valchev
Telerik team
 answered on 16 Dec 2014
1 answer
526 views
Hi,
I have an angular TreeView, and I need to reorder nodes from a specfic parent by a item property (index).
How can I do this?
Petur Subev
Telerik team
 answered on 16 Dec 2014
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
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?