Telerik Forums
Kendo UI for jQuery Forum
2 answers
365 views

I have a view model object . Here it is.

a{ b : {name : "p",id : "q", type : "text"} }

Here is my view.

<table data-template="myTemplate" data-bind="source: a"></table>

 <script type="text/x-kendo-template" id="leadFieldsTemplate">

    <tr>

          <td>

                  <input class="k-input k-textbox" data-bind=" attr: b  " />

          </td>

    </tr>

</script>​

But above method not working. 

Then I change it to like this

 <script type="text/x-kendo-template" id="leadFieldsTemplate">
    <tr>
          <td>
                  <input class="k-input k-textbox" data-bind=" attr: {name : b.name , id : b.id , type : b.type } " />
          </td>
    </tr>
</script>​​

Then it is working. So why the first method not working ???

In all time do I have to mentioned the attributes in the input field before bind them ??

 

Thank you

Rasika
Top achievements
Rank 1
 answered on 11 Sep 2015
1 answer
231 views
We have a scenario, where we have to show the listview data in the parent-child relation format. In the Parent row there should be a plus (+) symbol and on click of the plus symbol the child data should be opened. It’s basically group the data under the parent and show the child data on click of the plus symbol.

Kindly suggest us the approach or the code to accomplish our requirement.

Below sample code of my template for the listview without the parent-child relation and will have to modify the code to accommodate the new requirement.


<script type="text/x-kendo-tmpl" id="template">
        <div class="left-body-container">
            <table id="doc-list" class="doc-list" width="100%">
                <tbody>                   
                    # if (FolderName==null) { #
                    <tr id="tblRowFileItems" objectid="#:ObjectId#">
                        <td>
                            <listleft>
                                <img src="#:ImagePath#" />

                                <file-folder-names>
                                    <a data-role="button" href="GetDocumentContent?objId=#:ObjectId#" target="_blank" id="testa">#:DocumentName#</a>
                                </file-folder-names>
                                <br />

                                <span class="details">
                                    #:DocumentSize# <span class="paddingLR10">|</span> #:DocumentCreatedDate# :
                                    # if (!(DocumentCreatedby==null)) { # <a href=""> #:DocumentCreatedby# </a> # } #
                                </span>

                            </listleft>
                        </td>
                    </tr>
                    # } #
                </tbody>
            </table>
        </div>
    </script>

@(Html.Kendo().ListView<IndexModels>(Model)
                        .Name("listView")
                        .TagName("div")
                        .ClientTemplateId("template")
                        .DataSource(dataSource =>
                        {
                            dataSource.Read(read => read.Action("ReadDataonPaging", "Home").Data("additionalInfo").Type(HttpVerbs.Post));
                            dataSource.ServerOperation(true);
                            dataSource.PageSize(10);


                        })

                .Pageable(pager => pager

                                 .PreviousNext(true)
                         )
                )
Alexander Valchev
Telerik team
 answered on 11 Sep 2015
8 answers
1.0K+ views

Hi, i'm tring to add checkboxes and dropdownlist to my treelist 

I saw this exemple for the checkboxes: http://dojo.telerik.com/@gyoshev/ilUxi

but i'm not able to add the template field to my code,.

here's how my view code looks like:

     @(Html.Kendo().TreeList<Als.NxAudit.Dtos.RoleOperationDto>()
    .Name("treelist")
    .Selectable(true)
    .Columns(columns =>
        {
            columns.Add().Field(e => e.Operation.Name).Width(220);
        })
    .Sortable()
    .DataSource(dataSource => dataSource
        .Read(read => read.Action("TreeList_Read", "Role"))
        .ServerOperation(false)
        .Model(m => {
            m.Id(f => f.OperationID);
            m.ParentId(f => f.Operation.ParentID);
            m.Field(f => f.Operation.Name);
            })
        )
    .Height(540)
)

Marin
Telerik team
 answered on 11 Sep 2015
1 answer
156 views

Hello!

I've been chasing this bug that occurs when selecting a row in a grid within a Kendo pop-up window. In all non-IE browsers, I get an issue that causes the pop-up window to jump up when selecting a row. I've narrowed my search down to the Kendo method focusTable() which calls the focus() method on the table in all non-IE browsers. I've read focus() sets the active element and positions the window in the foreground. In contrast, IE's setActive() method does the same without positioning the window. Do you have any suggestions on a work around for this issue?

 I've attached some screencasts of the bug below:

 Thanks,

 Brian

http://screencast.com/t/R8EHG73dW

http://screencast.com/t/YZIZpvv0gYp​

Nikolay Rusev
Telerik team
 answered on 11 Sep 2015
2 answers
173 views

I'm having trouble binding the Grid to JSON data which is being delivered across a SignalR PersistentConnection with AngularJS. I'm not using hubs - effectively all that happens is a scope property is being updated, and I'd like the grid to update.

 

The relevant code that is called on update is:

/* ----- List of Sessions --------------- */
$rootScope.$on('Sessions', function (event, result) {
    $scope.$apply(function () {
        console.log(result);
        $scope.result = result;
 
    });
});

I want to bind the grid to $scope.result during the common lifetime of the grid and the connection. I've traced the code above and it's returning a repeating collection of JSON objects in a single parent object called 'data'. It looks like I'm missing something really simple, but I've been through lots of example code and still can't make it work.

 

Thank you

 

Colin Dixon

Colin
Top achievements
Rank 1
 answered on 10 Sep 2015
3 answers
232 views
Is there a way to set the "Drag" tooltip for kendo slider? I currently see the tooltip appearing as "Drag" and could not found a way to set it. Can you please let me know hot to set the custom tooltip in place of "Drag".
Iliana Dyankova
Telerik team
 answered on 10 Sep 2015
10 answers
1.9K+ views

Hi there,

This is a fairly common scenario which others have posted about but can't seem to find a solution.  I have a paged Kendo grid loaded from a remote datasource.  When the page loads, optionally there is an ID in the querystring representing the ID of a row.  I need the grid to go to the page of the grid for that ID.

The approach I'm taking is that in the dataBound event, query the datasource to get the index of the row with that ID, and then use that along with the page size to work out which page to goto.  However, I can't seem to find my ID in the datasource if it isn't on the currently visible page.  Here is my jQuery code to try and get the index :-

//// jump to page of querystring ID
        var ds = $('#grid').data('kendoGrid').dataSource;

        var view = kendo.data.Query.process(ds.data(), {
            filter: ds.filter(),
            sort: ds.sort()
        }).data;

        var index = -1;
        // find the index of the matching dataItem
        for (var x = 0; x < view.length; x++) {
            if (view[x].QuoteID == "11847") {  // hard-coded here for testing but will become a variable from querystring
                index = x;
                break;
            }
        }

Is my approach correct, and if so how can I make this work?  I need to be able to access the other items in the datasource not on the current visible page.  A code example would be appreciated.

Thanks, Mark

Nikolay Rusev
Telerik team
 answered on 10 Sep 2015
3 answers
207 views
Hello,

we have a project in which have our own widget extending the ChartElement. Currently we have Kendo UI version v2014.1.624. 
For now, we want to update to the latest Build of KendoUI(Kendo UI v2015.2.805) and figured out, that the ID-Attribute of Elements are missing in the Template of kendo.all.js. 

For example: new ShapeElement({type: SQUARE, id: "foo", background: "bar", width: 100});

We need the id-Attribute and it would be great if you can tell us, why this id-Attribute was deleted and how we can add this again.

Best regards,

Markus.
T. Tsonev
Telerik team
 answered on 10 Sep 2015
3 answers
77 views

I'm trying to load a two level structure into a treeview control.

The structure is like a calendar in that there is a date, followed by 1 or more events on that date.  

 They problem I have is that it displays correctly using a local array, but not when I get the data from an external source.  The 

two hierarchical definitions follow:

    window.calendarData = new kendo.data.HierarchicalDataSource({
        transport: {
            read: {
                url: "https://admin.medinet.ca/cgi-non/mmb/json_calendar.cgi",
                dataType: "json"
            }
        },
        schema: {
            model: {
                id: "eventId",
                hasChildren: "items",
                fields: {
                    eventId: {
                        editable: false
                    },
                    date: {
                        editable: true
                    },
                    items: {
                        model: {
                            id: "eventId",
                            fields: {
                                eventId: {
                                    editable:false
                                },
                                lastname: {
                                    type: "string",
                                    editable: true
                                }
                            }
                        }
                    }
                }
            }
        }
    });
    window.calendarDataLocal = new kendo.data.HierarchicalDataSource({
        data: [
            {
                eventId: 0,
                date: '2015-08-01',
                items: [
                    {
                        eventId: 1,
                        lastname: "poulin",
                        },
                    {
                        eventId: 2,
                        lastname: "smith",
                     }
                  ]
              },
            {
                eventId: 3,
                date: '2015-08-02',
                items: [
                    {
                        eventId: 4,
                        lastname: "jones"
                      }
                 ]
             }
        ]
    });

 

I'm pretty sure it has to do with my model definition, so if I'm doing something wrong in there please point me in the right direction.  I've tried a number of different approaches but so far no luck.

The result I'm seeing is that the for local array the control works as expected,  But the remote dataSource shows only the top level nodes and undefined for the lower level nodes.

 

Here is the div for displaying it.

    <div id="mainCalendar">
    </div>
    <script>
        $(document).ready(function () {
            $("#mainCalendar").kendoTreeView({
                dataSource: window.calendarData,
                dataTextField: ["date", "lastname"]
            })
        });
    </script>

Note that the dataTextField uses different name for each level.

 

Here is a copy of the data as returned from the  remote source.

[{

  "date":"2015-08-11",

  "eventId":0,

  "items":[{

    "firstname":"Fred",

    "stopTime":"11:00",

    "startTime":"10:30",

    "lastname":"Flintstone",

    "type":"paid",

    "eventId":1

  },

  {

    "stopTime":"12:44",

    "actvity":"lunch",

    "startTime":"12:00",

    "type":"unpaid",

    "eventId":1

  }]

},

{"date":"2015-08-12",

  "eventId":3,

  "items":[{

    "firstname":"Kermit",

    "lastname":"Frog",

    "type":"paid",

    "eventId":4

  }]

}]

Any help would be appreciated.  

Boyan Dimitrov
Telerik team
 answered on 10 Sep 2015
5 answers
1.7K+ views

Hi,

 

I'm trying to use the MaskedTextBox to format currency number. However, the fact that we can only set one mask is too limited. For instance, I'd like that if the user write "111", it formats "111". Then if user write an additional number, like "1111", it formats as "1 111", then by adding another number, it formats as "11 111", then "111 111", then "1 111 111" and so on...

 Is this possible?

Konstantin Dikov
Telerik team
 answered on 10 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?