Telerik Forums
Kendo UI for jQuery Forum
2 answers
228 views
Hello,
If I write:

<div data-role="view" id="offers" data-layout="general-home" data-title="Offers" data-show="filterOffers">
            <ul id="pull-to-refresh-offers"></ul>
        </div>
        <script id="productsTemplate" type="text/x-kendo-template">
            <div class="content_offers">
            <span class="title">#= NAME #</span>
            </div>
        </script>


and:

function filterOffers(e) {
     
    var scroller = e.view.scroller;
    scroller.reset();
    categoryID = parseInt(e.view.params.CategoryID);
     
    //console.log(categoryID);
     
    var getOffers = new kendo.data.DataSource({
 transport: {
 read: {
 dataType: "jsonp",
                                               
 beforeSend: function(req) {
 $("#pull-to-refresh-offers").hide();
 app.showLoading();
 },
                                               
 data: {
    action: "getOffers",
    CategoryID: categoryID
    }
 }
 },
 change: function() {
 app.showLoading();
                                               
 setTimeout(function() {
                                                          
 app.hideLoading();
 $("#pull-to-refresh-offers").show();
     }, 200);
                                               
                                               
         },
         schema: {
             data: "res"
         }
         });
     
    $("#pull-to-refresh-offers").kendoMobileListView({
               dataSource: getOffers,
               pullToRefresh: true,
               template: $("#productsTemplate").text()
          });
     
}


At the second time that I run the pull to refresh the "Pull to refresh" label is duplicate (see attached image)
Alexander Valchev
Telerik team
 answered on 29 Sep 2012
4 answers
439 views
Does anyone know how to stop a popup template from loading when the page does?  I really want to utilize my Edit, Add, and Delete ActionResults.  When I add .AutoBind(false) to my Grid, I get an error stating: "Cannot set AutoBind if widget is populated during initialization".  I REALLY don't want the widget to be populated during initialization.

Here's my grid on my Index.cshtml page:

@model IEnumerable<PosPayAndBankRec.Models.AccountListItem>

@{
    ViewBag.Title = "Account List";
}

<div id="grid"></div>

@(Html.Kendo().Grid(Model)
    .Name("Grid")
    .ToolBar(p => p.Create())
    .Columns(columns =>
    {
        columns.Bound(p => p.SourceName).Groupable(false).Title("Source");
        columns.Bound(p => p.BankName).Title("Bank");
        columns.Bound(p => p.AccountName).Title("Account");
        columns.Bound(p => p.AccountNumber).Title("Acct #");
        columns.Bound(p => p.AccountFolderName).Title("Folder");
        columns.Bound(p => p.RamQuestBankNumber).Title("Bank #");
        columns.Bound(p => p.AccountID).Hidden(true);
        columns.Command(p => p.Edit());
        columns.Command(p => p.Destroy());
    })
    .Pageable()
            .Editable(c => c.Mode(GridEditMode.PopUp).Enabled(true).DisplayDeleteConfirmation(true).Window(window => window.Title("Account")).TemplateName("AccountPopup"))
    .Sortable()
    .Scrollable()
    .Filterable()   
    .DataSource(dataSource => dataSource   
        .Ajax()
                .Sort(sort => sort.Add(p => p.BankName))
        .ServerOperation(false)
        .Model(model => model.Id(p => p.AccountID))
        //.Model(d => d.Id("AccountID"))
        .Update(update => update.Action("Edit", "Account"))
        .Create(create => create.Action("Create", "Account"))
        .Destroy(destroy => destroy.Action("Delete", "Account"))
     )
)


Here's my AccountPopup.cshtml:

@using System.Collections
@model PosPayAndBankRec.Models.AccountListItem

@{
    ViewBag.Title = "Account";
    SelectList sources = new SelectList("");
    SelectList banks = new SelectList("");
    if (Model.Sources != null)
    {
        sources = new SelectList(Model.Sources, "SourceID", "SourceName");
        banks = new SelectList(Model.Banks, "BankID", "BankName");
    }
}

<table id="table">
    <tr>
        <td>
            Source
        </td>
        <td>
            @Html.DropDownListFor(m => m.SourceID, sources)
        </td>
    </tr>
    <tr>
        <td>
            Bank
        </td>
        <td>
            @Html.DropDownListFor(m => m.BankID, banks)
        </td>
    </tr>
</table>

Rosen
Telerik team
 answered on 29 Sep 2012
1 answer
141 views
Check http://demos.kendoui.com/mobilethemebuilder/index.html
Tried to change list item font color whether using the color or font tools (rgba(x,x,x,x))
Couldn't do it.

Note that there are other controls whose style properties cannot be accessed from theme builder.
I suggest introducing keys to combine with mouse events, for example:
- default is changing background color (no key pressed while dragging a color over a UI object)
- when B (or Ctrl or whatever) is pressed, dragging a color over a UI object changes the border color
- when F (or Shift or whatever) is pressed, dragging a color over a UI object changes the font color

Kamen Bundev
Telerik team
 answered on 29 Sep 2012
2 answers
160 views
I want to get remote data from jsp with json type.
I have modified the example file :  virtualization-remote-data.html as follows :

            <script>
                $(document).ready(function() {
                    $("#grid").kendoGrid({
                        dataSource: {
                            serverPaging: true,
                            serverSorting: true,
                            pageSize: 100,
                            transport: {
                                read: "http://localhost:8060/data.jsp",
type: "jsonp"
                            },
schema: {
data: "results"
}
                        },
                        height: 280,
                        scrollable: {
                            virtual: true
                        },
                        sortable: true,
                        columns: [
                            "OrderID",
                            "CustomerID",
                            { field:"ShipName", title:"Ship Name" },
                            { field: "ShipCity", title:"Ship City" }
                        ]
                    });
                });
            </script>


And my data.jsp as follows:

<%@ page contentType="application/json" %>
<%@ page pageEncoding="UTF-8" %>

<%
try {
    //String json = "[{\"results\":[{\"OrderID\":\"100\",\"CustomerID\":\"122\",\"ShipName\":\"B\",\"ShipCity\":\"D\"}]}]";
String json = "{\"results\":[{\"OrderID\":\"100\",\"CustomerID\":\"122\",\"ShipName\":\"B\",\"ShipCity\":\"D\"}]}";

    response.getWriter().write(json);
} catch(Exception ex) {
}
%>

But the grid have not show any data after loading.

Is there any missing or mistakes in my code?

Thanks!


vipin
Top achievements
Rank 1
 answered on 29 Sep 2012
0 answers
146 views
Hi,

I want to insert the text of the node of the treeview where the user has dropped the node within editor.
Dropping of the node from  treeview to editor is achieved using Kendo DragAndDrop and Kendo Template. I am using template for each node and mark them as draggable. DragAndDrop feature of treeview is disabled as I don't want the nodes to be drag-n-drop within treeview. I am able to add the text where the cursor is within the editor (by using insertHtml) but not where the user has dropped the node.
For example, if user is trying to drop node on line 3 but the cursor is currently on line 1, the text is getting inserted in line 1 and not line 3.

Any idea how to achieve this?

Regards,
Monish.
Monish
Top achievements
Rank 1
 asked on 29 Sep 2012
3 answers
341 views
How do i wire up a custom grid edit template to have a united kingdom £ and curreny format 999.99 for example.



$('#test').width(250).kendoNumericTextBox({
    format: 'c2'
});

  <script id="popup_editor" type="text/x-kendo-template">
       <input id="test" />
</script>
chris
Top achievements
Rank 1
 answered on 28 Sep 2012
4 answers
2.6K+ views
I know this may seem minor, but it's an issue I'm trying to fix.  If you have an autocomplete and select a value, then clear it with .val(''), then select the same value, the change event doesn't fire.  This is a problem because I'm using the autocomplete with knockout and the observable doesn't get updated.  See this fiddle: http://jsfiddle.net/rniemeyer/Z8yL8/ 

Select red, click Reset, select red again and you'll see that it doesn't log the change to the console.

Aside from the fact that I'm using knockout, the change event should fire if you select something, then clear the value, then select a value.  It only does that when the second value is different from the first, even though the value was empty between them.

Is there any workaround for this issue without waiting for a release?

Regards,
Chris Rock

Chris
Top achievements
Rank 1
 answered on 28 Sep 2012
0 answers
172 views
Hi, 

I have kendo grid that is being binded in the js with a collection from the View Model. as follow when the page loads. 

$('Grid1').kendoGrid({ columns: this.Grid1.Columns, resizable: "true", selectable: "row", sortable: "true", rowTemplate: kendo.template($("#listview-rowTemplate").html()) });

At this point(when the page loads) the ViewModel collection has some default values, later in a callAction of a button event, the ViewModel collection is filled with different information for every column (text, width and others). Looking at the json retrieved the information is correct but the Grid is not being updated until I refresh the page using F5 and the js line of binding is executed again.

The binding is right because in another Grid the ViewModel Collection is filled before the binding and it shows the width, header text and all the rest of the information right.

My question is if the binding for the columns of a grid just work with initial values (previously loaded) and you cannot changes the titles and width or am I missing some details about binding and that´s why the grid is not updating the columns?

Thanks in advance!

Gonzalo
Top achievements
Rank 1
 asked on 28 Sep 2012
0 answers
146 views
I've a grid with a custom template modal window for edit & add. The template has drop down list field defined like below:

<div class="k-edit-label">
            <label for="ColName">Site</label>
</div>
<input name="ColName" data-source="ColNameDataSource" data-text-field="colName" 
      data-value-field="dartSiteName" data-bind="value:ColName" data-role="dropdownlist" />

When I edit a row and change the value of the drop-down it shows correctly in the grid.

But if I Add a row and change the value of the drop down it shows up as [object Object]. Does anyone have any idea what could I be doing wrong?
Thanks.
Just
Top achievements
Rank 1
 asked on 28 Sep 2012
0 answers
79 views
I have a hierarchical grid with 3 levels, in which the 2nd and 3rd levels are bound on the client side during expansion of the row through the OnDataBinding ClientEvent.

Sample code for binding I am doing:

    function detailGrid_dataBinding(e) {
        if ($(this) != undefined) {
            var grid = $(this).data("tGrid"),
                masterRow = $(this).closest("tr.t-detail-row").prev(),
                dataItem = $("#Status").data("tGrid").dataItem(masterRow);

            grid.dataBind(dataItem.Details);

            e.preventDefault();
        }
    }

However, when I apply the sorting/filtering/paging options to grid in the detail view, the visualization for the feature shows up but they don't function.

Is this a known issue?
John
Top achievements
Rank 1
 asked on 28 Sep 2012
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
ScrollView
Switch
TextArea
BulletChart
Licensing
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
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?