Telerik Forums
Kendo UI for jQuery Forum
3 answers
263 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
262 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
1 answer
168 views
Which IDE has code completion, intellisense, and error checking for use with Kendo?
N Mackay
Top achievements
Rank 1
 answered on 14 Aug 2012
7 answers
179 views
I found statements on an Accessibility page regarding support for these standards for the ASP.Net controls. I have been unable to find any similar statement regarding the Kendo UI controls. Can you clarify the current status/planned support.

Thanks
Doug Hay
Sebastian
Telerik team
 answered on 14 Aug 2012
1 answer
135 views
I'm receiving the following error when a date is either typed in or selected in a DatePicker in IE8 (doesn't happen in IE9)

Microsoft JScript runtime error: Object doesn't support property or method 'substr'
The error is happening on line 1346 of kendo.web.js

The DatePicker is in a pop-up editor:
The data is queried via a web service with a JSON response.

I am using a custom parser for the date returned from the service

I'm not sure why I'm receiving this error.
function customParser(data) {
    if (data != null) {
        var str = data.toString();
        if (str.indexOf("Date") >= 0)
            return new Date(parseInt(data.substr(6)));
    }
    else
        return data;

<!-- datepicker editor for field: "ManufactureDate" -->
        <input type="text"
            name="ManufactureDate"
            data-type="date"
            data-bind="value:ManufactureDate"
            data-role="datepicker" />

Cyndie
Top achievements
Rank 1
 answered on 14 Aug 2012
11 answers
707 views
Hi,

Is it possible to have different color on each column in a column chart and also to have different color depending on the value.
For instance if a column can have values from 0 -100 and you would like to have one color on values from 0-25 and one between values 26-75 and so on..

Kriti
Top achievements
Rank 1
 answered on 14 Aug 2012
0 answers
81 views
Hello,

Does Telerik grid for ASP.NET MVC2 (VS2008) exist? if so, please, provide the link to trial version.

We need such a grid with toolbar and other standard options.

Thank you in advance.

Goran
Goran
Top achievements
Rank 1
 asked on 14 Aug 2012
1 answer
184 views
i would like to access the messages of Response which is send by server whether it may be a failure or success message.
//===================================================== DATA SOURCES ==============================================================|
var projectDS = new kendo.data.DataSource({
    transport: {
        create: {
            url: '/api/HomeApi/Add',
            type: 'POST',
            contentType: 'application/json;charset=utf-8'   
        },
        read: {
            url: '/api/HomeApi/Get?projectId=' + $('#UrlProjectId').val(),
            dataType: 'json'
        },
        update: {
            url: '/api/HomeApi/Update',
            type: 'PUT',
            contentType: 'application/json;charset=utf-8',      
            success: function (response) { // this part also not works...
                alert(response.IsSuccess);
            }
        },
        parameterMap: function (options, operation) {
            if (operation !== 'read') {
                return JSON.stringify(options);
            }
            return options;
        }
    },
    schema: {
        model: {
            id: 'Id',
            fields: {
                Id: { type: 'number', editable: false },
                Title: { type: 'string',  },
                Description: { type: 'string' },
                StartDate: { type: 'date' },
                EstimatedEndDate: { type: 'date' }
            }
        }
         
    },
    change: function () {
        projectFormVM.set('currentRecord', this.view()[0]);
    },
    success: function (e) { // how to get this function works
        alert(e);
    }
});
 
//===================================================== VIEW MODELS ===============================================================|
// Add & Update Project View Model
var projectFormVM = kendo.observable({
    currentRecord: null,
    projectDataSource: projectDS,
    projectListUrl: '/Home/Projects',
    hasUpdate: (($('#UrlProjectId').val() != '') ? true : false),
    onStartDateChange: function () {
        var thisStartDate = this.get('currentRecord').StartDate;
        if (thisStartDate) {
            $('#EstimatedEndDate').data('kendoDatePicker').min(thisStartDate);
        }
    },
    onEndDateChange: function () {
        var thisEndDate = this.get('currentRecord').EstimatedEndDate;
        if (thisEndDate) {
            $('#StartDate').data('kendoDatePicker').max(thisEndDate);
        }
    },
    onSave: function () {
        this.projectDataSource.sync(); // -- synchronize the datasource when click the save button..
    }
});

The above code works properly both in add and update.
How to handle the response?...  My response object looks like {Success: true, Message: 'Record successfully updated...' }
Note: I m able to access the response using jquery ajax but i want to access only when datasource sync

Thanks in advance,
Ramesh
Ramesh
Top achievements
Rank 1
 answered on 14 Aug 2012
0 answers
193 views
Hi

I have a grid where I have a column with a custom editor template
{ field: "ShiftDefinitionId", title: "ShiftDefinitionId", format: "{0:n0}", width: "150px", editor: ShiftDefinitionIdEditor }

And also a corresponding editor template javascript function like
  function ShiftDefinitionIdEditor(container, options) {
    var inputField = $('<input data-text-field="ShiftDefinitionId" data-value-field="ShiftDefinitionId" data-bind="shiftDefinitionIdLookup: ShiftDefinitionId"/>')
    inputField.appendTo(container)
};

So now my problem is inside the custom binding
kendo.data.binders.shiftDefinitionIdLookup = kendo.data.Binder.extend({
  init: function () {
    var element = this.element;
  },
  refresh: function () {
    var element = this.element;
  }
});

this.element is undefined, but if i bind somewhere else the custombinding to a control, this.element is set.

How can I fix this problem

Regards
Roland
Roland
Top achievements
Rank 1
 asked on 14 Aug 2012
1 answer
181 views
hello
I'm new to kendo and was testing to see if buy the product while I'm making examples to see if I can use

I have a problem. I'm trying to do the  ForeignKeyColumn example but can´t  get the combobox when running
it show me a textbox (where should be the combo for my foreingkey) and 
I can edit it and change the id and grabs fine the data.    but I need a combo and i know something  is
 missing but can figure what

can you help please? 

My View

@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.CiudadViewModel>()
    .Name("Grid")    
    .Columns(columns => {        
        columns.Bound(p => p.id);
        columns.ForeignKey(p => p.empresa, (System.Collections.IEnumerable)ViewData["employees"], "id", "descripcion");        
        columns.Bound(p => p.descripcion);      
    })    
    .ToolBar(toolBar => toolBar.Save())
    .Editable(editable => editable.Mode(GridEditMode.InCell))
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()
    .DataSource(dataSource => dataSource        
        .Ajax()         
        .Batch(true)
        .ServerOperation(false)
        .Events(events => events.Error("errorHandler"))
        .Model(model => { 
            model.Id(p => p.id);
            model.Field(p => p.id).Editable(false);                
        })
        .Read(read => read.Action("ForeignKeyColumn_Read", "Home"))
            .Update(update => update.Action("ForeignKeyColumn_Update", "Home"))       
    )
)

MY VIEW MODEL

public class CiudadViewModel
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
        public int id { get; set; }

        public string descripcion { get; set; }

        public int empresa { get; set; }

        [UIHint("Empresas"), Required]
        public EmpresaViewModel Empresa { get; set; }
    }

MY CONTROLLER 

 public ActionResult GridForeingKey()
        {
            PopulateEmployees();
            return View();
        }

        private void PopulateEmployees()
        {
            ViewData["employees"] = new EFDbContext().Empresas
                        .Select(e => new EmpresaViewModel()
                        {
                            id = e.id,
                            descripcion = e.descripcion
                        })
                        .OrderBy(e => e.descripcion);              
        }

        public ActionResult ForeignKeyColumn_Read([DataSourceRequest] DataSourceRequest request)
        {
            return Json(SessionClientOrderRepository.All().ToDataSourceResult(request));
        }

    public class SessionClientOrderRepository
    {
        public static IEnumerable<CiudadViewModel> All()
        {
            IEnumerable<CiudadViewModel> result = HttpContext.Current.Session["ciudad"] as IEnumerable<CiudadViewModel>;
            if (result == null)
            {
               HttpContext.Current.Session["ciudad"] = result = new EFDbContext().Ciudades
                    .Select(o => new CiudadViewModel
                    {
                        id = o.id,
                        descripcion = o.descripcion,
                        
                        empresa = o.Empresa ,
                        Empresa = new EmpresaViewModel
                        {
                            descripcion = o.descripcion,
                            id = o.id
                        }
                    }).ToList();
            }
            return result;
        }
    } 
Emo
Top achievements
Rank 1
 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
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?