Telerik Forums
Kendo UI for jQuery Forum
2 answers
131 views
I am working on a project where Kendo UI SPA is a good fit.  I use Visual Studio as my development environment and found the Kendo UI SPA project template for Visual Studio 2013.  Unfortunately I am a VB programmer and the project template is only available for C#.

Do you expect to have a VB version soon or is there perhaps a way to convert the C# project to a VB.Net project?
Phil H.
Top achievements
Rank 2
 answered on 04 Jul 2014
15 answers
3.8K+ views
Any timeframe on when you hope to update the NuGet package to incorporate the 2012.1.515 release?
adRom
Top achievements
Rank 1
 answered on 04 Jul 2014
3 answers
116 views
Hi:

I am experiencing a jQuery error: Object doesn't support property or method 'apply', when I click on the button:
<script id='newButton-template' type='text/x-kendo-template'>
  <button class='k-button' data-bind='click: newProduct'><span class='k-icon k-i-plus'></span> New</button>
</script>
<div id='newProdView'>
</div>
<script type="text/javascript">
  var newProdViewModel = kendo.observable({
     newProduct: function (vm) {
       // vm is the view model
       alert(vm.target.innerText);
     }
  });
  var newTemplate = new kendo.View('newButton-template');
  newTemplate.render("#newProdView", newProdViewModel);
</script>

Phil
Phil H.
Top achievements
Rank 2
 answered on 04 Jul 2014
1 answer
80 views
I've created a sample application to illustrate the behavior here: http://trykendoui.telerik.com/ixuz

The gist of my problem is this:
If I have a string property on a model I can call model.set("property", "some value") and the view will be updated with the change.
If I have an array property on a model and call model.set("array", []) the view and the model become disconnected and no changes to the model will be reflected in the view.

In the sample application if you click the Add button next to the "List Items" heading you'll see new items added. This is done by calling model.items.push({...}).
If you click on the Reset button the code invokes a model.set("items", []) and the view is stuck in the current state. No more changes occur, though you can observe that model.items is changing by checking it's state from the console.

In contrast, if you click the Change button next to the "String Property" heading the code will invoke a model.set("property", "...") which does update the view correctly.

What is the proper way to re-initialize array members on an MVVM model?
Petyo
Telerik team
 answered on 04 Jul 2014
6 answers
206 views
I thought this was one of the most straightforward services offered by this component, but it comes out it is a very tough functionality, to offer.
So, to recap, what is a lookup combobox?
We have a model in input, where there is some sort of id (for example, int? IDProduct, for a table in the database where I have Products(ID, Name): it is nullable because the db field can be non-mandatory, of course).
If we are editing a new record, the value in the model is obviously missing, while if I'm editing a record, the field can or cannot have a specific value.
When showing the combo in the page, if the backing model has a value for the id, we would like to show the corresponding description of the product, otherwise the combo is void.
In each case, when we start typing in the field, after the specified number of chars, a search on the server is started to show the dropdown with the corresponding records.
We select one of the items, so fixing the whole text in the combo and recording a new value for the backing IDProduct (for example, in an observable object, or directly inside the control), and when we submit the page, we send the value to the server.
Lookup comboboxes have always existed in every good user interface library for handling db data, but, for what I could read, study, and try, it's not easily done with this component.
There are the datasource, the transport, the additionaldata, filter parameters, autobind true or false, the binding of a numeric value that becomes initially also the text shown in the combo, since there are not still values in the inner cache, and so on...
I opened tickets, and solved problems one at a time, but in each case, I fixed a problem just to open another, never closing the gap to obtain a really functioning solution.
Is there anyone who wrote some *real* code that can help me, with this problem?
I find very strange that Telerik didn't make a complete sample for this behaviour, that is *really* one of the basic, and most needed, functionalities for a component like this?
Or am I missing something really important???
Please help me, I'm tired and stuck... :-(
Andrea
Andrea
Top achievements
Rank 1
 answered on 04 Jul 2014
5 answers
483 views
Would you happen to have an example of using ajax in a client template? I have the following
columns.Template(c => @Ajax.ActionLink(c.UserName.ToString(), "GetPerson", "Home", null, new AjaxOptions { UpdateTargetId = "result" }, null)).Title("Index")
           .ClientTemplate("<a href='/Admin/Admin/GetUserRoles/#=UserName#'>#=UserName#</a>");

If I change my datasource to server() it works however my paging and editing cease working. When I change my datasource back to ajax everything else works but the parm I'm trying to my ActionMethod keeps returning null. Thanks.
Daniel
Telerik team
 answered on 04 Jul 2014
3 answers
465 views
Hello , 

When i load image image loader of your Text Editor my existing image is not showing up.  I am sure that my file path is correct but the image Thumbnail is not showing properly.  

I used used  thumbnail  but is now showing our current images.  Please check my code and screenshot attache herewith. 

01.settingOptions: {
02.                                                    tools: [
03.                                                            "bold",
04.                                                            "italic",
05.                                                            "underline",
06.                                                            "strikethrough",
07.                                                            "justifyLeft",
08.                                                            "justifyCenter",
09.                                                            "justifyRight",
10.                                                            "justifyFull",
11.                                                            "insertUnorderedList",
12.                                                            "insertOrderedList",
13.                                                            "indent",
14.                                                            "outdent",
15.                                                            "createLink",
16.                                                            "unlink",
17.                                                            "insertImage",
18.                                                            "subscript",
19.                                                            "superscript",
20.                                                            "createTable",
21.                                                            "addRowAbove",
22.                                                            "addRowBelow",
23.                                                            "addColumnLeft",
24.                                                            "addColumnRight",
25.                                                            "deleteRow",
26.                                                            "deleteColumn",
27.                                                            "viewHtml",
28.                                                            "formatting",
29.                                                            "fontName",
30.                                                            "fontSize",
31.                                                            "foreColor",
32.                                                            "backColor"
33.                                                            ],
34.                                                    imageBrowser: {
35.                                                       messages: {
36.                                                        dropFilesHere: "Drop files here"
37.                                                       },
38.                                                       schema: {
39.                                                          data: function(response){
40.                                                              //alert(response.toSource());
41.                                                              return response.data;
42.                                                          },
43.                                                          total: 'total',
44.                                                         //model: settingObj.model
45.                                                      },
46.                                                      //path: "<?php echo $this->preferences_data['file_path_articles_image']; ?>",
47.                                                      transport: {
48.                                                            read: {
49.                                                                type: "POST",
50.                                                                dataType: "json",
51.                                                                url: "<?php echo $this->url( array('module' => 'Portfolio','controller' => 'frontend', 'action' => 'grid' ), 'adminrout',    true) ?>",
52.                                                                data: {
53.                                                                            preferences_table           :   true,
54.                                                                            table_name                  :   "articles_preferences",
55.                                                                            primary_id_field            :   "id",
56.                                                                            primary_id_field_value      :   "1",
57.                                                                            primary_file_field          :   "",
58.                                                                            file_content                :   "",
59.                                                                            file_path_field             :   "file_path_articles_image",
60.                                                                            file_path_articles_image    :   "<?php echo $this->preferences_data['file_path_articles_image']; ?>",
61.                                                                            file_extension_field        :   "file_type",
62.                                                                            file_max_size_field         :   "file_size_max"
63.                                                                        }
64.                                                            },
65.                                                            destroy: {
66.                                                                url: "/kendo-ui/service/ImageBrowser/Destroy",
67.                                                                type: "POST"
68.                                                            },
69.                                                            create: {
70.                                                                url: "/kendo-ui/service/ImageBrowser/Create",
71.                                                                type: "POST"
72.                                                            },
73.                                                             
74.thumbnailUrl: "<?php echo $this->serverUrl().$this->baseUrl().'/'.$this->preferences_data['file_path_articles_image']; ?>",


Now , please check the screenshot and I need your help how can we load the existing image to thumbnail ? 

Dimo
Telerik team
 answered on 04 Jul 2014
1 answer
137 views
I am trying to disable the kendo combobox.

    $("#comboBoxid").kendoComboBox({
                                                            enable: false
                                                        });

this makes the _current property and datasource's data property  null.
 $("#comboBoxid").data(constKendoComboBox).current() is null.

How do I stop this? I don't want to delete the data attached to the kombobox.
subrat
Top achievements
Rank 1
 answered on 04 Jul 2014
1 answer
1.0K+ views
I have a grid that uses a ClientDetailTemplate.  The template is defined as: 

<script id="plan_client_template" type="text/kendo-tmpl">
 
    @(Html.Kendo().Grid<Rep.Models.BuildingChangeValidationViewModel>()
          .Name("CVGrid")
          .Scrollable()
          .Selectable()
          .Editable(editable => editable.Mode(GridEditMode.InLine))
          .Columns(columns =>
          {
              columns.Bound(b => b.Field);
              columns.Bound(b => b.BuildingChangeValidationStatusType).ClientTemplate("#=BuildingChangeValidationStatusType.Value#").Width(250);
              columns.Command(command => command.Custom("Update").Click("updateValidation"));
              columns.Command(command => { command.Edit(); }).Width(172);
          })
          .DataSource(dataSource => dataSource
              .Ajax()
                .Model(model =>
                {
                    model.Id(b => b.BuildingId);
                    model.Field(b => b.BuildingChangeValidationStatusType).DefaultValue(
                        ViewData["defaultBuildingChangeValidationStatuses"] as Rep.Common.LookupItem);
                })
              .PageSize(5)
            .Read(read => read.Action("BuildingValidations_Read", "Plan", new { buildingId = 0 }))
            .Update(update => update.Action("BuildingValidations_Update", "Plan"))
 
          )
          .ToClientTemplate()
    )
</script>

Note that a column uses a ClientTemplate.  The client template is simply a dropdown list. However, the grid is unable to locate the client template and instead returns the error:  "Uncaught ReferenceError: BuildingChangeValidationStatusType is not defined"

However, If I remove the detail grid from the Client Detail Template and put it in a div alongside the parent grid, and remove the ".ToClientTemplate()" call, it works perfectly. So there's something about placing a grid containing a column client template inside of a parent grid's client detail template that make it not work.  Any ideas? 

Dimiter Madjarov
Telerik team
 answered on 04 Jul 2014
1 answer
107 views
I have the following function that resets grid data:

function ReSetGridDataSource(grid, data, sort, emptyMessage) {
    if(grid.length > 0) {
        if(grid.substring(0, 1) !== '#') {
            grid = '#' + grid;
        }

        var grd = $(grid).data("kendoGrid");
        var ds =  new kendo.data.DataSource();
        
        
        ds.data(data);
        if(sort !== null && isArray(sort)) {
            ds.sort(sort);
        }
        
        if(emptyMessage !== null && emptyMessage !== undefined) {
            if(emptyMessage.length > 0 && ds.total() === 0 && $("#emptyMessageRow_" + grid) == null) {
                var colCount = $(grid).find('.k-grid-header colgroup > col').length;
                $(grid).append('<tr id="emptyMessageRow_' + grid + '" class="kendo-data-row"><td colspan="' + colCount + '" style="text-align:center; font-family:arial; font-size:24px;"><b>' + emptyMessage + '</b></td></tr>');
            }
        }
        else {
            try {
                $("#emptyMessageRow_" + grid).remove();
            }
            catch(err) {}
        }

        grd.setDataSource(ds);
        grd.refresh();
    }
}

The data is a JSON array of objects.  The application is designed specifically for an IPAD, after making changes to the data the above function is called, the grid content area blanks out, if I tap the blank area several times the data reappears, if I leave the grid alone (do not tap the blank area) the data never reappears.

I have alter the function for testing where the data is not refreshed if the grid has been previously bound, the content are remains visible.  



Dimo
Telerik team
 answered on 04 Jul 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
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
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
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?