Telerik Forums
Kendo UI for jQuery Forum
2 answers
127 views
Does Kendo UI have a replacement for a select element with a size attribute - essentially a list box?  I looked at the Kendo ListBox but didn't see how I could only have one item per row.

Thanks,
--Ed
Ed
Top achievements
Rank 1
 answered on 26 Jul 2014
6 answers
676 views
In my scenario I need to load a dropdownlist with data that is determined at runtime.

In my case I have a grid filed with a single product's master data.   Each row in the Kendo grid contains an attribute name and its associated value.   

ex. "Product Name" "Ibuprophen"
      "Strength"            "200 mg"
      "Form"                  "Casule"

Each attribute of the product comes from a different master data table, so what I was hoping to do was pass an entire object containing the information I need to dynamically load the dropdownlist to the editor template like so:

@model IEnumerable<NewGlobalProductCatalogue.Models.ProductInfo>

<p>Product Info - @ViewBag.ProductLanguage</p>
@{ string lang = ViewBag.ProductLanguage; }

@(Html.Kendo().Grid(Model)
    .Name("ProductInfo_" + lang)
    .Columns(columns =>
    {
        columns.Bound(c => c.ColumnName);
        columns.Bound(c => c.ProductData.FieldName);
        columns.Bound(c => c.ProductData).ClientTemplate("#: ProductData.MasterDataValue   
#").EditorTemplateName("EditorProductMasterData");       <<--this is the important line... ProductData is a class with all the data I need to look up the product master data

        columns.Command(command => { command.Edit(); });
    })
    .DataSource(d => d
      .Ajax()
      .Read(r => r.Action("Get", "Product"))
      .Model(m =>
      {
         m.Id(p => p.ProductData.FieldID);
         m.Field(p => p.ColumnName).Editable(false);
         m.Field(p => p.ProductData.FieldName).Editable(false);
         m.Field(p => p.ProductData.MasterDataValue).Editable(true);
      })
     .Update(u => u.Action("Update", "Product"))
     )
    .Pageable()
    .Editable(e => e.Mode(GridEditMode.InLine))   

And then in the editor I would pass the necessary parameters on to the .read action so that the controller would dynamically load the listbox from the correct table.   (NOTE: All the master data tables have a predictable field structure so I simply call a dynamic stored procedure which builds the appropriate SQL query)

Here was my editor:

@model NewGlobalProductCatalogue.Models.ProductMasterData
@(Html.Kendo().DropDownList()
.Name("MasterDataValues")
.DataValueField("MasterDataID")
.DataTextField("MasterDataValue")
.DataSource(d => d
   .Read(r => r.Action("Index", "MasterDataSelection", new { countrycode = Model.Country, lang = Model.Language, GlobalFieldName = Model.FieldName, MDTableName = Model.MasterDataTableName }))
)
.SelectedIndex(0)
)


Of course it all came crashing down when I realized that the editor template is only called once when the grid is built.   The weird part is, the controller that loads the data IS called every time I click on a rows EDIT button.
 
public class MasterDataSelectionController : Controller
    {
        //
        // GET: /MasterDataSelection/
        private APOIPCEntities db = new APOIPCEntities();
        public JsonResult Index(string countrycode, string lang, string GlobalFieldName, string MDTableName)
        {

           return  this.Json(db.GetCountryLanguageMasterData(countrycode,lang,GlobalFieldName, MDTableName), JsonRequestBehavior.AllowGet);

        }
}

I am wondering if someone can think of a sneaky way this behavior could be exploited to achieve the dynamic data loading I am looking for.   Maybe if I could put a function call in my controller that could look back into the grid to see what row it is currently focused on, and extract the necessary data from it prior to calling the stored procedure ..... just not sure how to do that.


Thanks for any thoughts you might have.

-Sheldon 








Sheldon
Top achievements
Rank 1
 answered on 25 Jul 2014
1 answer
188 views
I am using a kendo grid for a task list and when users click on the row item it opens a web page.

The hyperlink to the web page can be from different projects so this is all dynamic.

I am having a problem that sometime the the last part of my URL is truncated.

Below is my code from when the grid row is selected:

When i alert my data variable the Url is correct:
http://test/Workflow/SetStatus/1

But when the iframe is loaded the /1 part is removed.
The iframne tries top navigate to: http://test/Workflow/SetStatus

I have no answer as to why this happens.

function TaskItemSelected(e) {
        var sender = e.sender;
        var model = sender.dataItem(sender.select());
        if (!model) {
            return;
        }
        var serialNumber = model.SerialNumber;
        var data = model.Data;
        alert(data);
        $('html,body').css("cursor","wait");

        var windowElement  = $("<div />").attr("id", "taskdetailswindow").kendoWindow({
            modal: true,
            draggable: true,
            position: {
                top: 50,
                bottom: 50
            },
            resizable: true,
            width: "850px",
            height: "500px",
            title: "Task Details",
            actions: [
                "Close"
            ],
            iframe: true,
            content: data,
            refresh: function () {
                $('html, body').css("cursor", "auto");
            },
            close: function () {
                $("html, body").css("cursor", "auto");
                $("#TaskListGrid").data("kendoGrid").dataSource.read();
            },
            error: function () {
                $("html, body").css("cursor", "auto");
            }
        }).data().kendoWindow.center().open();
    }


Any ideas suggestions would be much appreciated.
Henk
Top achievements
Rank 1
 answered on 25 Jul 2014
3 answers
741 views
Hi there,

I wonder if I can add an extra information on the labels for my pie chart. Attached the preview. Regards. Claudia
T. Tsonev
Telerik team
 answered on 25 Jul 2014
5 answers
228 views
I am trying create a new custom widget based on this tutorial.
I came this far:
    var MyTextbox = kendo.ui.Widget.extend(
    {
        init: function (element, options)
        {
            kendo.ui.Widget.fn.init.call(this, element, options);
            $(element).css("border-color", "#FF0000");
        },
         
        options:
        {
            name: "MyTextbox",
        },
         
        events: ["dataBinding", "dataBound"],
         
        refresh: function()
        {
            var that = this;
            that.trigger("dataBinding");
            that.trigger("dataBound");
        }  
    });
    kendo.ui.plugin(MyTextbox);  
     
    </script>
</head>
<body>
    <input data-role="MyTextbox" />
    <input id="MyTextbox" />
    <script>
        $(document).ready(function()
        {
            $("#MyTextbox").kendoMyTextbox();
        });
    </script>
</body>
</html>
It works in case where I manually set kendoMyTextBox, but not where I use data-role attribute.

It would be also nice if someone help me with providing code, how can I set value attribute for value. I get undefined is not a function in line
kendo.bind($(document.body), MVVM);
 if I write 
<input data-role="MyTextbox" data-bind="value: valuerole" />
I don't know if I need to write some code in refresh or not?

And for the last: Why is preferred way to use that (instead of this) when creating custom widget. 
Matjaz
Top achievements
Rank 1
 answered on 25 Jul 2014
3 answers
1.0K+ views
 To select more than one item from the multiselect dropdown, user must click several times to launch dropdown and select the items individually. So the number of click increases to the respective number of items to be selected. Is there any property to set the drop down fixed and allow user to select more than one item in a single click.

Please advise even if this can be achieved through any other control. 
Dimo
Telerik team
 answered on 25 Jul 2014
1 answer
151 views
Hi Kendo Team:
I have a hierarchical kendo grid with selectable enabled. When I select a detail k-alt row in a master k-alt row, the detail row doesn't show its k-selected style.
The problem is the new .k-alt .k-alt style that makes a detail k-alt selected row doesn't apply its k-selected background color.

Here is an example of selectable hierarchical kendo grid. This also happens with v2014.2.724.

I've attached a picture. I've selected two rows. Look at order 10277.

Kind regards,
Oscar.
Dimiter Madjarov
Telerik team
 answered on 25 Jul 2014
5 answers
236 views
Hello,

I have a listview with tap and hold events:
- onTap: navigate to something
- onHold: show actionsheet

Now after the hold event, the tap event is also generated. How can I cancel that event?

Here is the jsBin http://jsbin.com/egasev/1/edit

Thanks,
Koen

P.S. Maybe you can make a Touch forum for these questions.


Sergey
Top achievements
Rank 2
 answered on 25 Jul 2014
5 answers
109 views
Hi.  I've created a split view application and I'm using the left panel as a menu.  I would like the selected menu item to appear selected when tapped.  I would also like any of the other menu items to become unhighlighted whenever a menu item is selected.  So only one of the menu items should ever appear to be selected.  Is this possible?

I'm binding in html as follows:

        <div data-role="view" data-title="Menu" id="side-root" class="no-backbutton">
            <!--Menu List -->
            <ul data-role="listview"
                id="mt-home-list-view"
                data-template="mt-main-tmpl-home-list"
                data-source="arrayOfHomeButtons">
            </ul>
        </div>
Kiril Nikolov
Telerik team
 answered on 25 Jul 2014
5 answers
216 views
Hello,

I have a list view with Endless scroll mode enabled. My list items have relatively big height (more than a half of page height) and have images.
Then I scroll an item the bottom of the item reaches list view top, the rest visible portion of the item gets disappeared. 
You can see this behavior here: http://dojo.telerik.com/eJuB/3

If items does not have any images - it works fine. Item can be scrolled from top to bottom and its internals are visible all the way.

Is it a bug? How can I prevent the item from erasing until it fully gets out of the view?

Thank you
Maxim
Top achievements
Rank 2
 answered on 25 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
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?