Telerik Forums
Kendo UI for jQuery Forum
1 answer
112 views
Hi,

I am trying to solve an issue where the data-bind="html:xx", returns "undefined" when the data "xx" is null or not defined.  It does not happen if this changes to text binding.  Is there any way to work around this on the client side?

Thanks for your help.
Kee Yang
Petur Subev
Telerik team
 answered on 29 Jul 2013
5 answers
1.1K+ views
Hi,

I have local data created in an array:
    var slices = [{id: 1, shorttext: "Cat", isselected: false}
                ,{id: 2, shorttext: "Bird", isselected: true}  ];

Turned into a datasource:
    var Kslices = new kendo.data.DataSource({data: slices});

Put into a grid:
    $("#rowselectorgrid").kendoGrid({
         dataSource: Kslices,
          columns: [{title:"Selector for row", template: $("#rowselectorTemplate").html()}]
     });

The rowselectorTemplate looks like:
    <script id="rowselectorTemplate" type="text/x-kendo-template">
                   <input id="#=id#" type="checkbox" #= isselected ? checked='checked' : '' #>
                    #=shorttext#
        </script>

This all works very well and presents a grid with two rows:
   checkbox + "Cat"
   checked checkbox + "Bird"


The user can now check/uncheck the checkboxes and then click a button to do something (doesn't matter what).

Question: How do I now iterate through the rows in the grid to find the checkboxes to see whether they are checked or not (and get the id attribute of the <input> tag so I can reference the original array)? I have tried a few ways, checked the forums, etc, but am lost...

Help!
 
Rosen
Telerik team
 answered on 29 Jul 2013
7 answers
235 views
Hi,

Where can I get/find a documentation for the usable data- attributes for all the widgets?

Thank you!
Kiril Nikolov
Telerik team
 answered on 29 Jul 2013
3 answers
290 views
i have download trial version and in example tried to customize add event form but i didn't able to customize.

please help me.h

Thanks
Dimiter Madjarov
Telerik team
 answered on 29 Jul 2013
2 answers
178 views
Please see the following image. I added en-GB as a selectable culture in your example project for scheduler globalisation. The day format on column headers is not changed to a UK format. It should be 'dd/mm'

Richard Lewis
Top achievements
Rank 1
 answered on 28 Jul 2013
1 answer
48 views
Hi All,

I have got a strange one here.  If I have this template assigned to a field on grid it works fine for existing items, but if I create an item the #Id# is zero.  I have check to make sure the datasource is updated after the item is saved and the Id is set to the new value.

{ field: "Name", title: "Name", width: "300px", "template": "<div class=\"sv-navcolumn\" data-id=\"accountdetail/#:Id#\" onclick=\"accountLaunchDetails(this)\" ><span class=\"sv-navcolumnlink\" >#: Name #<img src=\"/Images/arrow-right.png\" alt=\"Show Pointer\"></span></div>"}, 

Here is the resulting HTML

<div class="sv-navcolumn" data-id="accountdetail/0" onclick="accountLaunchDetails(this)"><span class="sv-navcolumnlink">test <img src="/Images/arrow-right.png" alt="Show Pointer"></span></div>

So when is the template evaluated when an item is created?  

Any  suggesting?

Regards

Richard....



Richard
Top achievements
Rank 1
 answered on 28 Jul 2013
2 answers
121 views
Hey all,
Some odd behavior happening when I try to filter the datasource for a grid.  Using the repro code below:

<!doctype html>
<html>
<head id="head" runat="server">
    <title></title>
      <link href="styles/kendo.common.min.css" rel="stylesheet" />
    <link href="styles/kendo.default.min.css" rel="stylesheet" />
    <script src="js/jquery.min.js"></script>
    <script src="js/kendo.all.min.js"></script>
        <script type="text/javascript">
            var ds;
            $(document).ready(function () {
                var peopleData = JSON.parse($("#gridData")[0].innerHTML);
                ds = new kendo.data.DataSource({ data: peopleData, pageSize: 5 });
                bindData();            
            });
            function bindData(filter) {
                if (filter)
                    ds.filter({
                        field: "SearchableText",
                        operator: "contains",
                        value: filter
                    });
                $("#Grid").kendoGrid({
                    columns: [{ field: "FullName", title: "Name" },
                                        { field: "Phone", title: "Phone" },
                                        { field: "Email", title: "Email" }],
                    dataSource: ds,
                    detailTemplate: kendo.template($("#detailTemplate").html())
                });
            }
            function dataSearch(inText) {      
                if (inText.length < 3)
                    bindData();
                else
                    bindData(inText.toLowerCase());
            }
        </script>  
</head>
<body>
  <form runat="server">
            Search: <input onkeyup="dataSearch(this.value)" type="text" />
            <div style="width:400px" id="Grid"></div>
            <script type="text/x-kendo-template" id="detailTemplate">
                    #= Details # 
            </script>
            <div style="display:none" id="gridData" runat="server">
                [
                    {"Phone":"1","Email":"A","Fax":"F","FullName":"Adam","SearchableText":"adam","Details":"det1"},
                    {"Phone":"1","Email":"A","Fax":"F","FullName":"Bob","SearchableText":"bob","Details":"det2"}
                ]                                          
            </div>
  </form>
</body>
</html>

The behavior seems different across browsers but using Chrome (28.0.1500.72 at the moment):
When the page first loads, if i click on to the search box and type "ada", the grid filters correctly bu when i click the expand details triangle, nothing happens.
If i instead press tab on page load to get to the input, the details expand correctly after filtering.
Additionally, if i type the full "adam" it doesn't work when i tab, but does when I click. It seems like every other keystroke will break the details expanding.


Any help would be appreciated.
Dessie Lunsford
Top achievements
Rank 2
 answered on 26 Jul 2013
2 answers
123 views
Hi,

are there any examples of MVVM and dataviz working together? Is it even possible? I've been trying to get a working chart that gets updated based on changes in a underlying mvvm data model with no luck for about a week now. Any example would help!
Bart
Top achievements
Rank 1
 answered on 26 Jul 2013
1 answer
243 views
Hi All,

I have been trying to get the datasource to refresh or update itself with the contents of a PUT response it sends to an odata service.  I know normally the PUT would return 204 with updating  a record, but I am returning a 200 with the contents that where updated.  The main reason for this is that a timestamp (ETAG) value is updated and returned in the response.  So the next time an edit is done on it should work, but currently it does not.

I have checked fiddler request/responses they are correct, it just that data source is not being refreshed with the contents being sent in the response.

Do I have to do a force refresh on the datasource and retrieve that page of data or is there another way?

The timestamp field is nested in the json response so I don't know if that is the cause or not.

Here is an example of the  request

PUT https://localhost:444/admin/v2/accounts(6) HTTP/1.1
Host: localhost:444
Connection: keep-alive
Content-Length: 325
Cache-Control: max-age=0
Accept: application/json, text/javascript, */*; q=0.01
Origin: https://localhost:444
X-Requested-With: XMLHttpRequest
If-Match: "AAAAAAAADJ0="
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36
Content-Type: application/json
Referer: https://localhost:444/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6

{"Id":"6","Name":"Test Account  5","Registered":null,"WebsiteUrl":"Testing","IsEnabled":true,"AccountType":"Retailer","Tracking":{"CreatedBy":"JhH1TV-f-P8cZgV19W0bhyI3UBLlHdbh79ZkzhnJSKA","CreatedOn":"2013-07-26T14:08:22.787","ModifiedBy":"JhH1TV-f-P8cZgV19W0bhyI3UBLlHdbh79ZkzhnJSKA","ModifiedOn":"2013-07-26T16:54:20.57","Timestamp":"AAAAAAAADJ0="}}

Here is an example of the response.

HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
ETag: "AAAAAAAADJ4="
Access-Control-Allow-Origin: *
DataServiceVersion: 3.0
Date: Fri, 26 Jul 2013 17:05:14 GMT
Content-Length: 425

{
  "odata.metadata":"https://localhost:446/admin/v2/%24metadata#accounts/@Element","Id":6,"Name":"Test Account  5","Registered":null,"WebsiteUrl":"Testing","IsEnabled":true,"AccountType":"Retailer","Tracking":{
    "CreatedBy":"JhH1TV-f-P8cZgV19W0bhyI3UBLlHdbh79ZkzhnJSKA","CreatedOn":"2013-07-26T14:08:22.787","ModifiedBy":"JhH1TV-f-P8cZgV19W0bhyI3UBLlHdbh79ZkzhnJSKA","ModifiedOn":"2013-07-26T17:05:13.9989111Z","Timestamp":"AAAAAAAADJ4="
  }
}

As you can see the ETag/Timestamp have been updated.

Any suggestions

Regards

Richard....
Richard
Top achievements
Rank 1
 answered on 26 Jul 2013
1 answer
93 views
Hello,

Here is a jsbin link to the problem I'm facing.

I want the autocomplete textbox to be docked left and right in a relative div and I ain't sure how to manage to width of the dropdown list items.

Also, while typing in the textbox, the dropdown seems to go up on the second letter typed.

Any input would be appreciated.

Thanx!
royguillaume
Top achievements
Rank 1
 answered on 26 Jul 2013
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
Date/Time Pickers
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)
SPA
Filter
Drawing API
Drawer (Mobile)
Globalization
Gauges
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
OrgChart
TextBox
Effects
Accessibility
ScrollView
PivotGridV2
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Collapsible
Localization
MultiViewCalendar
Touch
Breadcrumb
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
Popover
DockManager
FloatingActionButton
TaskBoard
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
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?