Telerik Forums
Kendo UI for jQuery Forum
5 answers
254 views

Hi I have a scheduler that I'm trying to apply dynamic filtering. From my research I found out about parameterMap... I have implemented it as follows...

In my Scheduler initialisation....

             dataSource: {
             type: "signalr",
             push: function (e) {
                 generateNotification(e.type, e.items[0].WRequestID, e.items[0].diary, e.items[0].team);
             },
             transport: {
                 signalr: {
                 hub: sHub,
                 promise: sHubStart,
                 ParameterMap: "parameterMap",
                 server:       {
                     read: "read",
                     create: "create",
                     update: "update",
                     destroy: "destroy"
                 },
                 client: {
                     read: "read",
                     create: "create",
                     update: "update",
                     destroy: "destroy"
                 }
             }
         },
         schema: {
            model: {
                id: "WRequestID",
                fields: {
                    WRequestID: {
                    type: "number",
                    editable: false,
                    defaultValue: -1
                },
                start: {
                    from: "Start",
                    type: "date",
                    culture: "en-GB"
                },
                end : {
                    from: "End",
                    type: "date",
                    culture: "en-GB"
                },
                diary: {
                    from: "Diary",
                    type: "string",
                    defaultValue: "@AppShort"
                },
                team: {
                    from: "Team",
                    type: "string",
                    validation: { required: true }
                },
                title: {
                    from: "Title",
                    type: "string",
                    validation: { required: true }
                },
                workManager: {
                    from: "WorkManagerID",
                    type: "number",
                    validation: { required: true }
                },
                assignee: {
                    from: "AssigneeID",
                    type: "number",
                    validation: { required: true }
                },
                changeRef: {
                    from: "ChangeRef",
                    type: "string",
                    validation: { required: true }
                },
                description: {
                    from: "Description",
                    type: "string",
                    validation: { required: true }
                },
                impactedServers: {
                    from: "ImpactedServers",
                    type: "string",
                    validation: { required: true }
                },
                impactedServices: {
                    from: "ImpactedServices",
                    type: "string",
                    validation: { required: true }
                },
                isBAU: {
                    from: "IsBAU",
                    type: "boolean",
                    defaultValue: false
                },
                projectRef: {
                    from: "ProjectRef",
                    type: "string",
                    validation: { required: true }
                },
                notes: {
                    from: "Notes",
                    type: "string"
                },
                isOOH: {
                    from: "IsOOH",
                    type: "boolean",
                    defaultValue: false
                },
                isAllDay: {
                    from: "IsAllDay",
                    type: "boolean",
                    defaultValue: false
                },
                recurrenceRule: {
                    from: "RecurrenceRule",
                    type: "string"
                },
                recurrenceId: {
                    from: "RecurrenceID",
                    type: "number"
                },
                recurrenceException: {
                    from: "RecurrenceException",
                    type: "string"
                },
                startTimezone: {
                    from: "StartTimezone",
                    type: "string"
                },
                endTimezone: {
                    from: "EndTimezone",
                    type: "string"
                },
                    requestStatus: {
                    from: "RequestStatus",
                    type: "number",
                    defaultValue: 0
                }
            }
        }

 

And my parametermap code is:

function parameterMap(data, type) {
 
        alert(type);
 
        if (type === "read") {
            data.filter = { logic: "and", filters: [{ field: "diary", operator: "eq", value: '@AppShort' }] };
        }
  
        return data;
    }

 

Where @AppShort is a value that has been derived at the beginning of the view... 

@Code
    ViewData("Title") = "Home Page"
    Dim AppShort As String
    AppShort = SupportDiary.My.MySettings.Default.AppShort
End Code

 

 

Unfortunately the filtering does not work... I get no errors... the scheduler just shows all scheduled events without filtering.

Veselin Tsvetanov
Telerik team
 answered on 16 Dec 2016
1 answer
358 views

I have custom template like below

schema: {
model: {
id: 'ID',
fields: {
myField: {

        {
          validation: { required: true,
         myfieldvalidation: function (input) {

                                        //Some logic goes here.
                                       input.attr("data-myfieldvalidation-msg", "This is not good");
                                    return false;
       }
}
}

}
}}}

 

and field declaration as

{field: "myField", template: function (dataItem) { return BuildInput(dataItem)}, title: "myField Value"}

calling following function as need logic to build textarea or to show read only. Calling following function just to clear code.

function BuildInput(dataObject) {

   if(editAllowed) {

    return ('<textarea rows="3" cols="4"  type="text" class="k-input k-textbox " name="myField " data-bind="value:myField " ></textarea>');

   } else {

    return dataObject.myField ;

   }

}

This textarea and binding works perfectly. But when I add validation like added above. On blur textarea is changing to input field which I don't want.

How to add validation in Kendo Grid with textArea template.

I have seen this: http://demos.telerik.com/kendo-ui/grid/editing-custom-validation

but above example deals only with input type not textarea.

Moreover, I can workaround with onchange function on textarea but,  onBlur Kendo is regenerating TD content so I can't use my external function to add error message there.

Boyan Dimitrov
Telerik team
 answered on 16 Dec 2016
2 answers
853 views

We currently have a DatePicker being displayed in a Kendo Window.  The DatePicker is located in an aspx which is displayed in an iframe within the Kendo Window. 

When the DatePicker calendar icon button is clicked, the calendar drops down (as show in the attached image) but as the calendar popup is too big for the iframe, you see the scroll bar appear for the overflow.  Yes, we could change the size of the frame, but I was hoping for a more complicated solution to tackle these scenarios.

Is it possible to nicely control the popup in this scenario? 

Maybe have it rendered in the parent?

Thanks

Paul

Georgi Krustev
Telerik team
 answered on 16 Dec 2016
1 answer
104 views

Hello,

Is there a way to create a template for parent task. Like we can create for child tasks?

Ivan Danchev
Telerik team
 answered on 16 Dec 2016
1 answer
72 views

Is there a way to do custom grid summary using selected rows?

So for example as a user selects rows on the grid, we would like to display a footer with a running total of the selection. But I read in the documentation that Kendo UI does not support custom group and table summary aggregation logic. So is there a way around that?

 

Thanks

Dimiter Topalov
Telerik team
 answered on 16 Dec 2016
5 answers
379 views

I have a requirement to detect and generate hyperlinks when the user keys in a url into the editor when not using Internet Explorer. Internet Explorer already has this inbuilt function to automatically convert hyperlinks, but firefox and other browsers don't.

Using the linkifyjs plugin from soapbox I'm able to get this done easily via the keyup event in Editor (calling the linkify html function on the entire editor.value() html whenever the user types in a letter), but there is a problem,  anything the user types after the url becomes part of the url text. It's like the cursor gets permanently stuck in the text part of the url <a href="some.url.com">I think this is where the cursor is stuck in</a>

 

1) Is there a method to call to exit the hyperlink and put the cursor gracefully after </a>?

2) I tried adding an &nbsp; at the back of the editor.value() to try to re-position the cursor, but it seems the editor strips it automatically, why is that the case?

3) Is there a better way to do this?

Ianko
Telerik team
 answered on 16 Dec 2016
19 answers
2.8K+ views
I have an application that has one split window where side A is a GoogleMap and side B is a Grid.
The grid is selectable:"multiple, row", and selections show small red footprints on the map when the item in the row is selected (in other words, item select in the grid will show up as a red bounding box in the map).

All this is working fine.

But sometimes the row-item selected is off screen on the map, and USERS are asking for the the ability to "click" on a row and have the map window scroll to center on that item.

Since row select (and thus <TR onclick() > is being used I was considered using jQuery to add:

$("#grid tr[data-uid]").dblclick( function(e) {panTo(e)});

To each of the 500+ data rows in the Grid (I have group headings also). I could also handle .keypress().

1 is this nuts, or is there more efficient or better way to do this? (i.e some sort of custom row editor? even though the grid is read-only)?
2. Which is better doubleclick or keypress?

Dimiter Topalov
Telerik team
 answered on 16 Dec 2016
2 answers
644 views

We made a responsive grid using CSS breakpoints, some columns are hidden in small resolution screens, when i export to PDF the file only shows columns showed in browser as a print screen, there is a way to print all columns???

thanks in advance!

Ismaelc
Top achievements
Rank 1
 answered on 15 Dec 2016
3 answers
642 views

I am using angularjs and have a kendo grid defined as follows

 MVC View

<div id="cumulativeResultView" class="txtLeft" ng-show="currentTab === 'cummulativeView'">
        <div id="clinReportContainer" >
            <div id="kendoGrid" kendo-grid k-options="resultGridOptions" k-rebind="resultGridOptions"
                  style="height:550px; width: 600px;margin-top:45px"></div>
        </div>
    </div>
    <script id="clinReportCellTemplate" type="text/x-kendo-template">
        <span class='ellipsisTxt'>
            #=testCode{0}.result ? testCode{0}.result :'' #
            <span ng-show="showUnits(dataItem, '#=testCode{0}.testCode#') ">#=testCode{0}.units#</span>
        </span>
    </script>

angular controller

01.$scope.showUnits = function (dataItem, testCode) {
02.    if (dataItem['testCode' + testCode] !== undefined)
03.        return dataItem[testCode].units === 'N';
04.    else return false;
05.}
06.var gridColumns = [
07.    {
08.        field: 'collectDate',
09.        title: 'Collect Date',               
10.        locked: true,               
11.        width: '150px'
12.    },
13.];
14.angular.forEach(uniqueTestCodes, function (testCode, key) {
15.    gridColumns.push({
16.        field: 'testCode'+testCode,
17.        title: testCode,
18.        template:kendo.format($('#clinReportCellTemplate')[0].innerHTML,testCode),
19.        width:'120px'
20.    });
21.});
22. 
23.$scope.reportGridData = gridData;
24.$scope.resultGridOptions = {
25.    dataSource: { data: gridData },
26.    columns: gridColumns,
27.};

 

When the locked property is set on the Collect date column, the grid contents are minimized and when the page is resized, the unlocked columns size appropriately, but the locked column shows no data. If I remove the locked property the gird displays as expected. What do I need to do to get the locked column to behave?

Gaurav
Top achievements
Rank 1
 answered on 15 Dec 2016
1 answer
73 views

In this example: http://jsfiddle.net/pmgkpgp0/

When I scroll content on background down and click on it and then I click on kendo window, content on background moves up. This problem occurs when I set value pinned: true

How to solve this problem?

Ianko
Telerik team
 answered on 15 Dec 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
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?