Telerik Forums
Kendo UI for jQuery Forum
2 answers
167 views

Hi,

 We are trying to display data from a wfc data service, in a Kendo treelist UI control.  The data bind is not happening and "request failed" keeps showing up. From what we saw it seems to be an issues due to the format of the data although type = 'jsonp' has been specified. Could you please guide us with some of the version requirements for the entity framework and if we need to explicitly do anything in the data service to get the right format. In the data that the service returns the header -  "d":[{"__metadata"] is seen.

 

Thanks!!

 

 

Kiril Nikolov
Telerik team
 answered on 02 Sep 2015
1 answer
236 views

Hey guys, 

i have a dropdown and after select i can edit the selected entry in a form (like http://demos.telerik.com/kendo-ui/mvvm/remote-binding). In the form is another dropdown that depends on another datasource, but the selected value is based on the first on. But if i send a save, then the whole Objekt from the second dropdown is send (something like {ID:"1",text:"abc",check:"true"}) and not the ID only. How can i achieve, that only the ID would be send? 

 

The code vor the observable for the first dropdown which delivers informations for the form:

$(document).ready(function() {
    var objectViewModel = kendo.observable({
        objectSource: new kendo.data.DataSource({
            transport: {
                read: {
                    url: '" . $config['odata_url'] . "Objects?\$filter=ID eq \'" . $_GET["id"] . "\'',
                    dataType: 'json',
                    type: 'GET',
                    contentType: 'application/json',
                    complete: function (jqXhr, textStatus) {
                        if (textStatus == 'success') {
                            $('#windowPopupNotification').data('kendoNotification').show('Data loaded successfully (Object)', 'success');
                        } else {
                            $('#windowPopupNotification').data('kendoNotification').show('Error while loading data (Object)', 'error');
                        }
                    }
                },
                update: {
                    url: '" . $config['odata_url'] . "Objects(\'" . $_GET["id"] . "\')?lang=de',
                    dataType: 'json',
                    type: 'MERGE',
                    contentType: 'application/json',
                    complete: function (jqXhr, textStatus) {
                        if (textStatus == 'nocontent') {
                            $('#windowPopupNotification').data('kendoNotification').show('Data saved successfully (Object)', 'success');
                        } else {
                            $('#windowPopupNotification').data('kendoNotification').show('Error while saving data (Object)', 'error');
                        }
                    }
                },
                parameterMap: function(options, operation) {
                    if (operation !== 'read' && options) {
                        return kendo.stringify(options);
                    }
                }
            },
            batch: false,
            schema: {
                data: 'd.results',
                model: {
                    id: 'ID'
                }
            }
        }),
        selectedObject: null,
        save: function() {
            this.objectSource.sync();
        },
        reset: function() {
            this.objectSource.read();
        },
        close: function() {
            gridItemDetailsWindowClose();
        },
        showForm: function() {
            return this.get('selectedObject') !== null;
        },
    });
    kendo.bind($('#objectForm'), objectViewModel);
});

 The PHP code for the dropdown in the form.

$DropDown = new \Kendo\UI\DropDownList('DropDownID');
$DropDown->autobind(true)
                    ->attr('data-bind', 'value: selectedObject.ID')
                    ->attr('data-value-field', 'ID')
                    ->attr('data-text-field', 'Name')
                    ->dataSource($myDataSource);
 

 

Thanks a lot!

Chris

 

 

 

Nikolay Rusev
Telerik team
 answered on 02 Sep 2015
6 answers
617 views

Kendo grid mvc não carrega os dados.

--- My Class

    public class ItemPainelValidacao
    {
        public int id { get; set; }
        public string linkAcao { get; set; }
        public string statusAcao { get; set; }
        public DateTime? data { get; set; }
        public TimeSpan? horaValidacao { get; set; }
        public string numeroProtocolo { get; set; }
        public string usuarioSolicitante { get; set; }
        public string emailUsuario { get; set; }
        public string nomeCadastro { get; set; }
        public string tipoCadastro { get; set; }
        public string tempoEspera { get; set; }
        public string status { get; set; }
        public string usuarioValidador { get; set; }
    }

--- My Controller.


        public ActionResult CarregarPainel([DataSourceRequest]DataSourceRequest request)
        {
            List<ItemPainelValidacao> dados = new PainelValidacao().getAll();
            DataSourceResult result= dados .ToDataSourceResult(request);
            return Json(result, "text/x-json", JsonRequestBehavior.AllowGet);
        }

-- My View


        <script type="text/javascript" src="@Url.Content("~/Scripts/kendo/2013.2.918/jquery.min.js")"></script>
        <style type="text/css">
            #Grid *
            {
                font-size: 12px !important;
            }
        </style>
        @(Html.Kendo().Grid<ItemPainelValidacao>()
            .Name("Grid")
            .Columns(columns =>
            {
                columns.Bound(o => o.data).HeaderTemplate("Data");
                columns.Bound(o => o.linkAcao).HeaderTemplate("Ação");
                columns.Bound(o => o.numeroProtocolo).HeaderTemplate("Numero Protocolo");
                columns.Bound(o => o.usuarioSolicitante).HeaderTemplate("Usuario Solicitante");
                columns.Bound(o => o.emailUsuario).HeaderTemplate("Email Usuário");
                columns.Bound(o => o.nomeCadastro).HeaderTemplate("Nome Cadastro");
                columns.Bound(o => o.tipoCadastro).HeaderTemplate("Tipo Cadastro");
                columns.Bound(o => o.tempoEspera).HeaderTemplate("Tempo Espera");
                columns.Bound(o => o.status).HeaderTemplate("Status");
                columns.Bound(o => o.usuarioValidador).HeaderTemplate("Usuário Validador");
            })
                .Pageable(pagerAction => pagerAction.Numeric(false))
                .Pageable(pagerAction => pagerAction.Input(true))
                .Sortable()
                .Filterable()
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .PageSize(10)
                        .Read(read => read.Action("CarregarPainel", "Validacao"))
                )
            )

-- Json generated

{"Data":[{"id":1,"linkAcao":"Cliente/Validar/25","statusAcao":null,"data":"\/Date(1380198093000)\/","horaValidacao":null,"numeroProtocolo":"CLI03091325","usuarioSolicitante":"XXXXXXXXXXXXXXXXXXXX","emailUsuario":"XXXXXXXXXXXXXXXXXXXX","nomeCadastro":"Cliente","tipoCadastro":"Alteração","tempoEspera":"5 dia(s) 3 hora(s) 33 minuto(s) 50 segundo(s)","status":"ForaDoPrazo","usuarioValidador":null},{"id":2,"linkAcao":"Cliente/Validar/0","statusAcao":null,"data":"\/Date(1378477021000)\/","horaValidacao":null,"numeroProtocolo":"CLI0609130","usuarioSolicitante":"XXXXXXXXXXXXXXXXXXXX","emailUsuario":"XXXXXXXXXXXXXXXXXXXX","nomeCadastro":"Cliente","tipoCadastro":"Novo","tempoEspera":"25 dia(s) 1 hora(s) 38 minuto(s) 22 segundo(s)","status":"ForaDoPrazo","usuarioValidador":"XXXXXXXXXXXXXXXXXXXX"},{"id":3,"linkAcao":"Cliente/Validar/53","statusAcao":null,"data":"\/Date(1378478562000)\/","horaValidacao":null,"numeroProtocolo":"CLI06091353","usuarioSolicitante":"XXXXXXXXXXXXXXXXXXXX","emailUsuario":"XXXXXXXXXXXXXXXXXXXX","nomeCadastro":"Cliente","tipoCadastro":"Novo","tempoEspera":"25 dia(s) 1 hora(s) 12 minuto(s) 41 segundo(s)","status":"ForaDoPrazo","usuarioValidador":null},{"id":4,"linkAcao":"Cliente/Validar/54","statusAcao":null,"data":"\/Date(1378478778000)\/","horaValidacao":null,"numeroProtocolo":"CLI06091354","usuarioSolicitante":"XXXXXXXXXXXXXXXXXXXX","emailUsuario":"XXXXXXXXXXXXXXXXXXXX","nomeCadastro":"Cliente","tipoCadastro":"Novo","tempoEspera":"25 dia(s) 1 hora(s) 9 minuto(s) 5 segundo(s)","status":"ForaDoPrazo","usuarioValidador":null},{"id":5,"linkAcao":"Cliente/Validar/62","statusAcao":null,"data":"\/Date(1379017479000)\/","horaValidacao":null,"numeroProtocolo":"CLI12091362","usuarioSolicitante":"XXXXXXXXXXXXXXXXXXXX","emailUsuario":"XXXXXXXXXXXXXXXXXXXX","nomeCadastro":"Cliente","tipoCadastro":"Novo","tempoEspera":"18 dia(s) 19 hora(s) 30 minuto(s) 44 segundo(s)","status":"ForaDoPrazo","usuarioValidador":null},{"id":6,"linkAcao":"Cliente/Validar/86","statusAcao":null,"data":"\/Date(1379610704000)\/","horaValidacao":null,"numeroProtocolo":"CLI19091386","usuarioSolicitante":"XXXXXXXXXXXXXXXXXXXX","emailUsuario":"XXXXXXXXXXXXXXXXXXXX","nomeCadastro":"Cliente","tipoCadastro":"Novo","tempoEspera":"11 dia(s) 22 hora(s) 43 minuto(s) 39 segundo(s)","status":"ForaDoPrazo","usuarioValidador":null},{"id":7,"linkAcao":"Cliente/Validar/100","statusAcao":null,"data":"\/Date(1380290092000)\/","horaValidacao":null,"numeroProtocolo":"CLI270913100","usuarioSolicitante":"XXXXXXXXXXXXXXXXXXXX","emailUsuario":"XXXXXXXXXXXXXXXXXXXX","nomeCadastro":"Cliente","tipoCadastro":"Novo","tempoEspera":"4 dia(s) 2 hora(s) 0 minuto(s) 31 segundo(s)","status":"ForaDoPrazo","usuarioValidador":null},{"id":8,"linkAcao":"Cliente/Validar/30","statusAcao":null,"data":"\/Date(1380310072000)\/","horaValidacao":null,"numeroProtocolo":"CLI27091330","usuarioSolicitante":"XXXXXXXXXXXXXXXXXXXX","emailUsuario":"XXXXXXXXXXXXXXXXXXXX","nomeCadastro":"Cliente","tipoCadastro":"Alteração","tempoEspera":"3 dia(s) 20 hora(s) 27 minuto(s) 31 segundo(s)","status":"ForaDoPrazo","usuarioValidador":null},{"id":9,"linkAcao":"Transportadora/Validar/25","statusAcao":null,"data":"\/Date(1380198093000)\/","horaValidacao":null,"numeroProtocolo":"TRA26091325","usuarioSolicitante":"XXXXXXXXXXXXXXXXXXXX","emailUsuario":"XXXXXXXXXXXXXXXXXXXX","nomeCadastro":"Transportadora","tipoCadastro":"Alteração","tempoEspera":"5 dia(s) 3 hora(s) 33 minuto(s) 51 segundo(s)","status":"ForaDoPrazo","usuarioValidador":null},{"id":10,"linkAcao":"Veiculo/Validar/88","statusAcao":null,"data":"\/Date(1380567784000)\/","horaValidacao":null,"numeroProtocolo":"VEI30091388","usuarioSolicitante":"XXXXXXXXXXXXXXXXXXXX","emailUsuario":"XXXXXXXXXXXXXXXXXXXX","nomeCadastro":"Veiculo","tipoCadastro":"Novo","tempoEspera":"0 dia(s) 20 hora(s) 52 minuto(s) 20 segundo(s)","status":"ForaDoPrazo","usuarioValidador":null}],"Total":10,"AggregateResults":null,"Errors":null}

The JSON file is generated , but the grid is not loaded with data.
What should I do for this to work? Any help will be appreciated.

khaja Nawaz
Top achievements
Rank 1
 answered on 01 Sep 2015
1 answer
1.7K+ views

I have to change sorting icon and filter icon with with bootstrap glyphicon. Also how can i customize filter menu. 

 

Iliana Dyankova
Telerik team
 answered on 01 Sep 2015
3 answers
413 views

My example: http://dojo.telerik.com/oWABE/3

Here I have a data object containing "status" which is an integer! (it is 1,2 or 3)

In my Grid that masks to New, Pending and Closed

To show the strings (New, Pending and Closed) I have created a parse function in the shema -> for filtering to work on the parsed values one cannot use a template in the columns definition, but has to parse it in the datasource!

Status: { type: "int",
         parse: function(status) {   
         console.log(status,"stat");           
           switch(status){
             case 1: return"New"; break;
             case 2: return"Pending"; break;
             case 3: return"Solved"; break;
             case 5: return"Closed"; break;
          }
     }
},
 
There is a "console.log" when this parser gets called and what I notice is that AFTER! I filter for "New" the log reads:

n stat
undefined "stat"

 

...when I first run the page the log reads (as expected):

 

1 "stat"
2 "stat"
3 "stat"

 

The Filter does not work (try filtering for "New" as an example)
Any help?
Kiril Nikolov
Telerik team
 answered on 01 Sep 2015
2 answers
66 views

Hi, I have a problem with charts where the maximum values of a series are "just above" a multiple of the unit on the y-axis. I've set up a minimal example at 

http://dojo.telerik.com/uqIME/2

 

You will see that the two data points are above the maximum value shown on the y-axis, and the data markers are partly obscured. I would expect the y-axis to be extended so that the data points are within its range (e.g. Excel has a max of 1200 on the y-axis for the same series).

I suppose I could work around this by calculating and explicitly setting the maximum, but it would be better if the chart could do this itself. Or is there some other  setting I can use to force it?

 Thanks

Andrew 

 

Andrew
Top achievements
Rank 1
 answered on 01 Sep 2015
6 answers
1.6K+ views
Kendo UI window only provides the way to add title on window, is there a way to add a footer sticking to bottom while window height is not fixed?
Basically I am looking for footer similar to twitter bootstrap modal

http://getbootstrap.com/javascript/#modals

<div class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">Modal title</h4>
</div>
<div class="modal-body">
<p>One fine body&hellip;</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>

</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
Iliana Dyankova
Telerik team
 answered on 01 Sep 2015
3 answers
246 views
I have a chart that is able to be filtered by date. I would like to always display 3-5 labels in the categoryAxis, that shows the start date, end date and a few points along the way to assist the user in identifying the data. I have only seen that you can step the labels and display on the nth one, however, my data set varies in size based on the date range, meaning a different set and number of labels is displayed based on the query. Is there any way to fix the number of labels that show and to have them do a min, max, median?

Thanks in advance.
Iliana Dyankova
Telerik team
 answered on 01 Sep 2015
3 answers
531 views
Seems simple enough, but after looking though the threads I can't find an answer.  So, everyone knows you can bind a view model to an element and you can get the validator from an element or most any other kendo object.  But, how do you get the view model bound to the element?  In case the example is unclear, I'm trying to retrieve the viewModel in the getViewModel function w/o using some kind of global variable.

function setViewModel() {
    var viewModel = kendo.observable({name:'John Doe'});
    kendo.bind($("form"), viewModel);
}

function getViewModel() {
    var viewModel = $('#form').kendo(???);
}

<div id="form">
//usual binding stuff
</div>

Thanks,
nick
Petyo
Telerik team
 answered on 01 Sep 2015
1 answer
82 views

I just want to disable all hover text for the column heading. However with the code below a nuisance hover text of the column title appears when the mouse is over the column heading.

The datasource for the grid is built by cursoring a datasource from another API and building the local data source on the fly, in case that offers a clue...

The results are shown in the attached png

                columns: [{
                        field:"Source",
                        title: "Source BOGUS", // causes the hover problem
                        filterable: false,
                        sortable:true
                    },{
                        field:"Name",
                        filterable: false,
                        sortable:true
                    },{
                        field:"findResultPayload",
                        headerAttributes: {
                            style: "display: none"
                        },
                        filterable: false,
                        width: 50, 
                        hidden: false,
                        template: '<img src="images/zoom.png" width="16" height="16"/>'
                    }
                ]

TIA

Radoslav
Telerik team
 answered on 01 Sep 2015
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?