Telerik Forums
Kendo UI for jQuery Forum
2 answers
125 views
Hi,

So, im using a template binded to remote data. Everything works well on the emulator but on the device only the button appears.
code:

    <form>
            <ul id="books" data-template="template" data-role="listview" data-style="inset" data-bind="source:fields"></ul>
            <button data-role="button" id="save" type="button" class="login-button">Save</button>
  </form>
   <script id="template" type="text/x-kendo-template">
           <li >
                    <label for="page">#: Caption #</label>
                    # if (EditConfigType =="Lookup"){
                    #<select id="dropdown"></select>#
                    }
                    if (EditConfigType =="Integer"){
                    #<input type="number"  />#
                    }#
          </li>
  </script>
<script>
            $(function () {
                // create a template using the above definition    #: Caption #
                var template = kendo.template($("#template").html());

                var dataSource = new kendo.data.DataSource({
                    transport: {
                        // specify the XML file to read. The same as read: { url: "books.xml" }
                        read: {
                            url: "http://41.74.247.118/3GS_API/appapi.svc/uitemplatefields/2120b826-8db8-435c-97db-a1a753fc3e1a",
                            dataType: "json"
                        },
                        
                    },
                    schema: {
                        model: {
                            fields: {
                                IdEditConfig: { type: "string" },
                                Caption: { type: "string" },
                                EditConfigType: { type: "string" },
                                Required: { type: "number" },
                            }
                        }
                    },
                    change:
                        function (e) {
                        $("#books").html(kendo.render(template, this.view()));
                    }
                });

                dataSource.read();
                dataSource.fetch(function () {
                    var data = this.data();
                    console.log(data[0].IdEditConfig + " | " + data[0].Caption + " | " + data[0].EditConfigType + " | " + data[0].Required + " | ");
                });
            });
        </script>

please help! Thanks!
Petyo
Telerik team
 answered on 24 Mar 2014
2 answers
149 views
I followed the instructions to successfully create a Chrome Packaged App at: http://www.telerik.com/kendo-ui/chrome-packaged-app

I'd like to add the KendoEditor to the test project in the instructions.  The instructions have us create a main.html that is located outside the sandbox with a full screen iframe pointed to an index.html that is located inside the sandbox.  The Kendo UI uses a templating system that requires it is located in the sandbox.  It appears the KendoEditor uses an iframe and that causes the error pasted below when I add it to index.html.  How do I add a KendoEditor to a Chrome Packaged App?  Thanks.


Sandbox access violation: Blocked a frame at "chrome-extension://cfciefpodjoeapkegnopjnblkgaolpka" from accessing a frame at "null".  Both frames are sandboxed and lack the "allow-same-origin" flag. kendo.upload.js:490
s.extend._createContentElement kendo.upload.js:490
s.extend._initializeContentElement kendo.upload.js:594
s.extend.init kendo.upload.js:420
ut.initWidget kendo.columnmenu.js:519
(anonymous function) kendo.grid.js:402
b.extend.each jquery-1.9.1.js:7123
b.fn.b.each jquery-1.9.1.js:6735
ut.init kendo.grid.js:402
pt.init kendo.grid.js:3956
u.extend._model (index):1
u.extend.init (index):1
ut.initWidget kendo.columnmenu.js:519
D.extend._createView (index):1
D.extend.showView (index):1
historyCallback (index):1
i._historyNavigate (index):1
o.extend.navigate (index):1
(anonymous function) (index):1
b.extend.each jquery-1.9.1.js:7123
o.extend.showStart (index):1
u.extend.switchWith (index):1
D.extend._show (index):1
o (index):1
D.extend.showView (index):1
historyCallback (index):1
(anonymous function) (index):1
n.extend.trigger kendo.colorpicker.js:763
o.extend._urlChanged kendo.grid.js:1101
o.extend.start kendo.grid.js:1067
l.Observable.extend._startHistory (index):1
(anonymous function) (index):1
c jquery-1.9.1.js:7341
p.fireWith jquery-1.9.1.js:7403
b.extend.ready jquery-1.9.1.js:6875
H
Nathan
Top achievements
Rank 1
 answered on 23 Mar 2014
3 answers
902 views
In my server side code I fetch the data to be displayed in the grid and it's returned as an IEnumerable. Can I use this as a datasource and if so how would I do this server side?
Scott
Top achievements
Rank 1
 answered on 22 Mar 2014
1 answer
460 views
Unfortunately the color binding is not working:

            <div id="CounterChart" class="dsb-production-chart" data-bind="visible: group4ChartView()">                
                <div id="CounterChart2" data-role="chart"
                     data-legend="{ position: 'bottom' }"
                     data-series-defaults="{ type: 'line' }"
                     data-series="[
                                     { field: 'OutputCounter', name: 'Output'},
                                     { field: 'RejectCounter', name: 'Reject'},
                                     { field: 'TotalCounter', name: 'Total'}
                                 ]"
                     data-series-line-color:"['yellow','red','green']"                     
                     data-bind="source: LineChartCounters"></div>
                </div>
            </div>
                   

What did I wrong?

kind regards
Alex
Kevin Kembel
Top achievements
Rank 1
 answered on 21 Mar 2014
1 answer
273 views
I need to create a dropdownlist in my custom edit view. This is what I've done so far, and shows all the inputs except the dropdownlist

<!--Edit template-->
<script type="text/x-kendo-template" id="editNominationsTmpl">
    <div id="editContainer">
        <table>
            <thead>
                <tr>
                    <td></td>
                    <th>Nominee</th>
                    <th>Nominator</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <th>Name:</th>
                    <td><input type="text" class="k-input k-textbox" name="NominatedName" value=" #= NominatedName # " /></td>
                    <td><input type="text" class="k-input k-textbox" name="NominatorName" value=" #= NominatorName # " /> </td>
                </tr>
                <tr>
                    <th>Job Title:</th>
                    <td><input type="text" class="k-input k-textbox" name="NominatedTitle" value=" #= NominatedTitle # " /></td>
                    <td><input type="text" class="k-input k-textbox" name="NominatorTitle" value=" #= NominatorTitle # " /> </td>
                </tr>
                <tr>
                    <th>Department:</th>
                    <td>
                        <input id="dropdownlistNominee" name="DeptId" />
                    </td>
                    <td><input type="text" class="k-input k-textbox" name="NominatorDept" value=" #= NominatorDept # " /></td>
                </tr>
                <tr>
                    <th>Email:</th>
                    <td>
                        <input type="hidden" name="Index" value=" #= NominatedIndex # " />
                        <input type="hidden" name="RequestInfoID" value="#= NominatorIndex # " />
                    </td>
                    <td><input type="email" class="k-input k-textbox" name="NominatorEmail" value=" #= NominatorEmail # " /></td>
                </tr>
            </tbody>
        </table>
        <div class="edit-buttons">
            <a class="k-button k-button-icontext k-update-button" href="\\#"><span class="k-icon k-update"></span>Save</a>
            <a class="k-button k-button-icontext k-cancel-button" href="\\#"><span class="k-icon k-cancel"></span>Cancel</a>
        </div>
    </div>
</script>

//Creates a global object called templateLoader with a single method "loadExtTemplate"
var templateLoader = (function ($, host)
{
    //Loads external templates from path and injects in to page DOM
    return {
        //Method: loadExtTemplate
        //Params: (string) path: the relative path to a file that contains template definition(s)
        //Params: (int) index: user index
        loadExtTemplate: function (path, fileName, index)
        {
            //Use jQuery Ajax to fetch the template file
            $.get(path, { name: fileName },
                function (result) {
                    console.log(result);
                    $(host.body).append(result);
                    console.log($(host.body).html());
                })
                .done(function (data)
                {
                    $(host).trigger("TEMPLATE_LOADED", [path , index]);
                    console.log("Published an event that indicates when a template is done loading");
                });
        }
    };
})(jQuery, document);

// waits until the template is fully loaded
        $(document).bind("TEMPLATE_LOADED", function (e, path, index)
        {
            // send to create the dropdownlist
            createDropdownList(index);

            var wnd = $("#nominationsEdit").data("kendoWindow");
            console.log(wnd);

            var templateContent = $("#editNominationsTmpl").html();
            console.log(templateContent);

            var editTemplate = kendo.template(templateContent);
            console.log(editTemplate);

            $.get("/Admin/GetEditNominations",
                {
                    index: index
                },
                function (data) {
                    console.log(data);
                    //dataTemplate = data;
                    //dataDropwDown = loadDropdownListInfo();
                },
                "json")
                .done(function (data)
                {
                    console.log("success getting the information... now create the dropdaownlist");

                    // populate the template with the information
                    var result = kendo.render(editTemplate, data);

                    // set the default value the dropdownlist will show
                    // $("#dropdownlistNominee").kendoDropDownList().index(data.DeptID);

                    // append the information to the new window
                    wnd.content(result);

                    // show the window
                    wnd.center().open();
                });
        });

function createDropdownList(index)
{
    //create the dropdownlist
    $("#dropdownlistNominee").kendoDropDownList(
        {
            dataTextField: "DeptName",
            dataValueField: "DeptID",
            dataValueField: index,
            dataSource:
                {
                    transport:
                        {
                            read:
                                {
                                    url: "/Admin/GetDeptInfo"
                                }
                        }
                }
        });
}

with this code the custom edit window shows all the inputs information, except the dropdownlist this input, that it shows empty.

What I'm missing?

thanks in advance.


Lienys
Top achievements
Rank 2
 answered on 21 Mar 2014
3 answers
374 views
Hi

We have a client requirement to display a graph as per the example attached. We recommended Kendo UI as a platform now we need some assistance to implement this. Has anyone done something like this? My initial thoughts was to combine a line chart with an area chart but was unable to get this working as per the example. (The example was done in excel 2007)

Thanks for the assistance
Szymon
Top achievements
Rank 1
 answered on 21 Mar 2014
2 answers
120 views
Hi.

I have a Devcraft UI subscription and would like to have access the server wrappers and the kendo complete options.  Do I need to buy a new $999 license for that?

regards,
Olafur
Ólafur Gíslason
Top achievements
Rank 1
 answered on 21 Mar 2014
7 answers
1.0K+ views
When I create the items in the panelbar, I am passing in an id like this:

panelbar.append({text:m.text, id:m.id});

I need a way to get this id back when an item is selected, but I can't figure out how to do it.

Getting just the text isn't sufficient.

Thanks,
Adam
Petyo
Telerik team
 answered on 21 Mar 2014
5 answers
181 views
I can't seem to initialize the chart's seriesDefaults.type property by using data attributes:

data-series-defaults-type="line"

Should this work, or am I doing something wrong?
Iliana Dyankova
Telerik team
 answered on 21 Mar 2014
5 answers
183 views
I have a grid that has worked perfectly fine for nearly a year now, however when I updated to the latest kendo release it has started generating an error when trying to sort by any of the columns.

It's generating the following error
Invalid property or field - 'undefined' for type: worldStatsItem

Where worldStatsItem is the type of item used in the grid.

I'm using teh MVC bindings for this and the code for the grid is below.

@(Html.Kendo().Grid(Model.Results)
                         .Name("Search_Results")
                  
                         .Columns(columns =>
                             {
                                 
                                 columns.Template(m => Html.ActionLink(m.StatsItem.OutfitName, "OutfitByID","OutfitDetails", new { outfitId = m.StatsItem.OutfitId},null)).Title("Name").Width(200);
                                 columns.Bound(m => m.World).Width(100).Title("Server");
                                 columns.Bound(m => m.StatsItem.Faction).Width(100).Title("Faction");
                                 columns.Bound(m => m.StatsItem.TotalMembers).Width(100).Title("Total Members");
                                 columns.Bound(m => m.StatsItem.TotalXP).Width(100).Title("Total XP");
                                 columns.Bound(m => m.StatsItem.KdRatio).Width(100).Title("Ratio");
                                 columns.Bound(m => m.StatsItem.AverageXp).Width(100).Title("Average XP Per Member");

                                  
                                   })
                                          .Sortable(sorting => sorting.Enabled(true))
                                       
                                          
                                       
                                                         
                                          .Pageable(pageable => pageable.ButtonCount(5))
                                          .DataSource(dataSource => dataSource
                                          .Server()
                                    
                                          .PageSize(40)
                                          .Sort(sort =>
                                          sort.Add(x=>x.StatsItem.AverageXp).Descending())
                                           
                                          
 
                                                  ))
Michael
Top achievements
Rank 1
 answered on 21 Mar 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
Drag and Drop
Map
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
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?