Telerik Forums
Kendo UI for jQuery Forum
2 answers
272 views

Hi,

I have an issue with draggable ui element. I'm trying to achieve following:

 

- I have a widget that essentially a div (no plugins).

- I have an iframe inside that div.

- I applied draggable to that widget

$(widget).kendoDraggable({
                           hint: function (element) {
                               return element.clone();
                           }
                       });

I need to see widget when I drag it around. This is why I use 'hint' but because it's a copy of original iframe, it doesn't preserve it's state, it reloads the whole page again, and if user navigated inside the iframe, lets say he scrolled, it's not even the same look.

Is there any possibility that I can drag the same element but not the copy?

Thank you.

Sergey
Top achievements
Rank 1
 answered on 24 Jun 2016
1 answer
545 views

Hi,

Pressing the ESC key will normally close a kendo window. But when the kendo window contains an iframe, then pressing the ESC key wont close the window. For instance I have a kendo window containing an iframe, which in turn contains an input text component. Upon opening of the window the input text component gets the focus. Pressing the ESC button now won't close the window. Any suggestions on how to get this scenario working?

Regards,
Ron

Alex Gyoshev
Telerik team
 answered on 24 Jun 2016
3 answers
7.9K+ views
How do I right align currency in a grid cell?
Oren
Top achievements
Rank 1
 answered on 24 Jun 2016
4 answers
432 views
     1st Grid in a partial view which is rendering fine:

    @(Html.Kendo().Grid<OpenInvoicesInfo>()
      .Name("OpenInvoiceGrid")
      .ColumnMenu(i => i.Columns(false))
      .Columns(columns =>
      {
          columns.Bound(p => p.INVOICE).ClientTemplate("<input type='checkbox' value='#= INVOICE #' class='testclass'  />").Width(4);
          columns.Bound(i => i.INVOICE).Title("Invoice").Width(15);


    2nd grid rendering fine intially with initial given invoices but not sure how to get selected checkbox invocies from first grid and updated 2nd grid

    @(Html.Kendo().Grid<CustomerComments>()
      .Name("CustomerCommentsGrid")
      .ColumnMenu(i => i.Columns(false))
      .Columns(columns =>
      {
          columns.Bound(i => i.Invoice).Title("Invoice").Width(15);
          columns.Bound(i => i.Comment).Title("Comment").Width(40);

      }).Pageable(pageable => pageable
          .Refresh(true)
      )
      .Scrollable()
      .Sortable()
      .Filterable()
      .DataSource(dataSource => dataSource
          .Ajax().UseJniErrorHandler()
          .PageSize(10)
              .Read(read => read.Action("GetCustomerComments", "Maint"))
      )
)

    <script type="text/javascript">
        function GetAllInvoicesComments() {
            var result = [];
            var items = $("#OpenInvoiceGrid").find(".testclass").filter(":checked");
            items.each(function () {
                result.push({
                    Value: $(this).val(),
                    Checked: true
                });
            });

            $.ajax({
                url: webManager.resolveUrl("~/maint/GetCustomerComments"),
                //data:  
                method: "POST",
                data: { invoices:result},
                success: function () {
                    var grid = $('#CustomerCommentsGrid').data('kendoGrid');
                    grid.dataSource.read();
                    grid.refresh();
                },
                error: function () {
                    alert('an error occurred');
                }    
            });
        }

</script>

      2nd Grid's Controller - I am able to invoke and able to pass selected invoices in parameter:

        public ActionResult GetCustomerComments([DataSourceRequest] DataSourceRequest request, string invoices)
        {   
            invoices = "'F300003634','F300003764'";//hard coding to see it first time     
            List<JNI.Enterprise.Contracts.CustomerComments> customer = InvoiceService.GetCustomerComments(invoices);

            return Json(customer.ToDataSourceResult(request));
        }

Problem is it is again getting called because of this .Read(read => read.Action("GetCustomerComments", "Maint")) and I don't want to call them 2nd time only call once when page is loaded initially.

Thank you.

Also wondering is it possible to update grid if it is in different partail view?
Right now just FYI 2nd partial view with 2nd grid (from 1st partial view) is not loading.
Gaurav
Top achievements
Rank 1
 answered on 23 Jun 2016
3 answers
705 views

I have 2 comboboxes that will be used to filter data in a kendo grid.  I am trying to filter the second combobox's data based on the selection from the first combobox.  Both comboboxes retrieve their data from Angular service methods.  The data is an array, and then I add an extra record at the beginning of each array in case no filter is requested.  In the select option of the first combobox, I have a method that will place a filter on the second combobox's dataSource.  It requires two filters due to including the extra record.  I have included an "or".  However, when I run the code, my filter is showing up with an "and".  Is it not possible to use two filters that filter on different fields with an "or"?

I am including the important parts of the code below. I was trying to follow the examples, but it just seems to use "and" for my filter.  

Thanks for any assistance on this!!

myService.availableCategories.get(
    null,
    function (data) {
        var results = data.results;
        results.unshift({
            categoryID: 0,
            categoryName: "All",
            sortOrder: 0
        });
        vmFilters.categoryOptions = {
            dataSource: new kendo.data.DataSource({
                data: results
            }),
            dataTextField: "categoryName",
            dataValueField: "categoryID",
            filter: 'contains',
            value: vmFilters.selectedCategory,
            select: function (e) {
                var dataItem = this.dataItem(e.item.index());
                onCategorySelect(dataItem.categoryID);
            }                   
        };
    },
    function (error) {
        console.log(error);
    });
 
myService.availableOptions.get(
    null,
    function (data) {
        vmFilters.optionListAll = data.results;
 
        var initialItem = {
            optionID: 0,
            optionName: "All"
            categoryID: 0
        };
        vmFilters.optionListAll.unshift(initialItem);
        vmFilters.optionOptions = {
            dataSource: new kendo.data.DataSource({
                data: vmFilters.optionListAll
            }),
            dataTextField: "optionName",
            dataValueField: "optionID",
            value: vmFilters.selectedOption 
        };
    },
    function (error) {
        console.log(error);
    });
 
 
function onCategorySelect(categoryID) {
    if (categoryID !== 0) {
      vmFilters.optionOptions.dataSource.filter({
          logic: "or",
          filters: [
           { field: "categoryID", operator: "eq", value: categoryID },
           { field: "optionID", operator: "eq", value: 0 }
           ]
      });
    } else {
        vmFilters.optionOptions.dataSource.filter({});
    }
    vmFilters.optionOptions.dataSource.read();
    console.log(vmFilters.optionOptions.dataSource);
}

Christy
Top achievements
Rank 1
 answered on 23 Jun 2016
2 answers
108 views

Hi,

I have a problem with Kendo Editor using AngularJs.

When I insert some empty lines (enter), and save, it adds ng-scope to the paragraphs. So when it reloads the value, the placeholder crashes.

Was wondering if you could help me with that.

Please take a look at the attached screenshot.

 

Thanks

 

Negin
Top achievements
Rank 1
 answered on 23 Jun 2016
5 answers
488 views

In a Kendo Grid, I have a column that contains a date.  I'm using this method for inserting my own control into the cell to edit the date:

function dateTimeEditor(container, options)
{
    console.log("options", options);
    $('<input data-text-field="' + options.field + '" '
      + 'data-value-field="' + options.field + '" '
      + 'data-bind="value:' + options.field + '" '
      + 'data-format="' + options.format + '" '
      + '/>')
        .appendTo(container)
        .kendoDateTimePicker(
        {
            format: "MM/dd/yyyy",
            parseFormats: [ "yyyy/MM/dd", "MM/dd/yyyy", ],
        });
} 

In the column definition I have this:

{
    field: "probeDate",
    title: "Probe Date",
    width: 60,
    format: "{0:MM/dd/yyyy}",
    editor: dateTimeEditor,
    attributes: { class: "editable-cell" },
}

So far this works great.  Now I wanted to add custom validation to this control, so in the model I have a field defined like this:

type: "date",
editable: true,
validation:
{
    validateProbeDate: function (input)
    {
        if (console != undefined) { console.log(input); }
 
        // Validate the probeDate as well as all of the dynamic fields.
        if (input.val().trim() === "" || parseDate(input.val()) == null )
        {
            input.attr("data-validateProbeDate-msg",
                       "Probe Date must be a valid date value (mm/dd/yyyy or yyyy/mm/dd).");
            return false;
        }
        // TODO: Make sure the date falls within the bounds of the probe.         
        // return new Date(input.val()) < probeStartDate...
 
        return true;
    }
}

This works as far as the validation as it doesn't allow me to leave the field unless my validation method returns true, but the error message won't show on the field and I've tried several methods to try to get it to show up.  I assume the problem is in dateTimeEditor() where I'm defining the date edit control.

You can see this in action in this fiddle: Probe Data Entry

Thanks in advance!
Scott
Top achievements
Rank 2
 answered on 23 Jun 2016
1 answer
79 views

Hi,

I used "selectable: 'multiple, row'" as our treeList option, such that we can multi-select tree items (via shift-key or ctrl-key). It works fine on desktop browsers.

However, when we use iPaq (Safari) or Android Tablet (Chrome), it is very difficult to scroll the tree since touch-and-move on the tree will be treated as multiple selecting the tree item. Only when I touch on the treeList thin right-edge and move, it will scroll sometimes. It is not so user-friendly.

Do anyone have any suggestion? e.g. can we have visible scroll bar for treeList on mobile device?

Please kindly advise. Thanks!

Kelvin

 

 

 

 

 

 

Stefan
Telerik team
 answered on 23 Jun 2016
3 answers
597 views

Can someone tell me exactly how the grids behavior changes when EnableCustomBinding is set to true?

Does it change the request that is sent?

Does it change the data that is expected from the server?

Does it change how binding is done?

Does it work differently if ServerOperation is true or false?

 

 

Daniel
Telerik team
 answered on 23 Jun 2016
2 answers
82 views

The latest 2016 version treelist some time doesn't return the right data when apply the filter on column.

Here's the code which you can repeat that bug. When I apply a filter on column ClassSecurity start with "U", the data is incorrect. But the old 2015 version is good.

2016 version  http://dojo.telerik.com/@cchu/IwUso

2015 version  http://dojo.telerik.com/@cchu/uZADe

 

 

Congyuan
Top achievements
Rank 1
 answered on 23 Jun 2016
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
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?