Telerik Forums
Kendo UI for jQuery Forum
1 answer
3.2K+ views
Hi

I need aggregate function SUM to skip some column values based on other column value. In another words I don't want to include all column values in sum but only those for which the another column value, say Record_ID == 1. I think of a kind of custom function with if condition.
Is it possible in grid?
Daniel
Telerik team
 answered on 02 Jun 2016
1 answer
216 views
Hello,

Currently, is there a way to compare Kendo filters?

Example of equalities:
* {"logic":"and","filters":[{"value":"abc","operator":"eq","field":"type"},{"value":"xyz","operator":"eq","field":"model"}]}
* {"logic":"and","filters":[{"logic":"or","filters":[{"value":"abc","operator":"eq","field":"type"}]},{"value":"xyz","operator":"eq","field":"model"}]}
* {"logic":"and","filters":[{"logic":"or","filters":[{"value":"abc","operator":"eq","field":"type"}]},{"logic":"or","filters":[{"value":"xyz","operator":"eq","field":"model"}]}]}
* {"logic":"and","filters":[{"value":"abc","operator":"eq","field":"type"},{"logic":"or","filters":[{"value":"xyz","operator":"eq","field":"model"}]]}}
* {"logic":"and","filters":[{"value":"xyz","operator":"eq","field":"model"},{"value":"abc","operator":"eq","field":"type"}]}
* ...

There are many ways that Kendo generate equal filter queries (such as the "Clear" button). However, I did not find a way to compare...

Thanks,
Pascale Audet
Georgi Krustev
Telerik team
 answered on 02 Jun 2016
3 answers
177 views
Hi!

I have some troubles with drawer. I have the application with the login page. After the user is authenticated I navigate his on page "Cabinet" using 

app.mobileApp.navigate('components/cabinet/view.html')


But when I open the drawer on the second page I see the previous login page.

The code of drawer:

<div data-role="content" class="corplight-drawer">
    <header data-role="header" id="drawerHeader">
        <div class="company-name" data-bind="text: company"></div>
        <a class="change-company"
             data-role="button"
             data-rel="actionsheet" href="#clientsActionsheet"><span></span></a>
    </header>
    <ul id="navigation-container" data-role="listview" class="drawer-menu">
        <li class="drawer-accounts"><a data-icon="corp-accounts" href="components/accounts/view.html">Рахунки</a></li>
        <li class="drawer-loans"><a data-icon="corp-loans" href="components/loans/view.html">Кредити</a></li>
        <li class="drawer-deposits"><a data-icon="corp-deposits" href="components/deposits/view.html">Депозити</a></li>
        <li class="drawer-transfers"><a data-icon="corp-transfers" href="components/transfers/view.html">Новий платіж</a></li>
        <li class="drawer-payments"><a data-icon="corp-payments" href="components/payments/view.html">Платежі</a></li>
        <li class="drawer-templates"><a data-icon="corp-templates" href="components/templates/view.html">Шаблони</a></li>
        <li class="drawer-products"><a data-icon="corp-products" href="components/products/view.html">Продукти</a></li>
        <li class="drawer-users"><a data-icon="corp-users" href="components/users/view.html">Співробітники</a></li>
        <li class="drawer-map"><a data-icon="corp-map" href="components/map/view.html">Відділення та банкомати</a></li>
        <li class="drawer-exrate"><a data-icon="corp-exrate" href="components/exrate/view.html">Курси валют</a></li>
        <!--<li class="drawer-exit"><a data-icon="corp-exit" onclick="app.appLogout();" >Вихід</a></li>-->
    </ul>
</div>


What is the problem?

P/S/ please find the screenshot with problem in the attached file   

 

Petyo
Telerik team
 answered on 01 Jun 2016
4 answers
470 views

Does the count measure count the itens using DISTINCT?

For instance, let's say we have a dataSource like this:

 

var dados = [{ PersonID: 2958, Address: "5h St"},{ PersonID: 2958, Address: "​Lexington Ave"},{ PersonID: 2958, ​Address: "76th Street"}]

 

Note that it is only 1 person, which has 3 address.. if I wanted to use the COUNT measure on the Address, it is correct (it counts 3 itens). But when I use the COUNT measure on the PersonID, it also counts 3 itens, but there is only one personID. If the COUNT measure does not use DISTINCT, Is there any workaround for this? 

Jorrit
Top achievements
Rank 1
 answered on 01 Jun 2016
2 answers
201 views

Hi,

Like you see it on this example: http://dojo.telerik.com/@Janek91/AbUSE if I try to change available tools in the embedded Editor - in result I'm getting it duplicated, that's because I'm using k-ng-model directive. There is a possible workaround here: http://dojo.telerik.com/@Janek91/Eseva I can simply use Angular to paste HTML into <textarea> tag and not to use k-ng-model. But is there really no other way to use k-ng-model, configure tools and don't get duplicated Editor?

Jan
Top achievements
Rank 1
 answered on 01 Jun 2016
5 answers
294 views

I guess I'm not understanding the hierarchical grid when it comes to editing. 

Is the parent dataSource in no way connected to the child dataSources? So, when saving, I have to loop through and call save on every child grid? 

Does it not use a hierarchical DataSource?

 

 

Dimiter Topalov
Telerik team
 answered on 01 Jun 2016
6 answers
336 views
I have recently started to work with the LinearGauge control, but don't see a way to increase the size of the colored bands that define the ranges.  The bands are very thin, giving the gauge somewhat the appearance of a thermometer.  I would like thicker bands that are easier to see at a glance -- for a horizontal gauge, this would be a height increase in the bands; for a vertical gauge, a width increase.  The scale.rangeSize option accomplishes this for a RadialGauge, but is there any similar setting for a LinearGauge?  Alternatively, are there style settings that could do the same thing?

Regards,
Fred
Dimiter Madjarov
Telerik team
 answered on 01 Jun 2016
6 answers
1.8K+ views
Hello,

I have a grid like the one from your demo: http://demos.telerik.com/kendo-ui/grid/hierarchy
<div>
        @{
            Html.Kendo().Grid<TicketModel>()
                .Name("ticketsList")
                .HtmlAttributes(new { @class = "ticketsGrid" })
                .Columns(columns =>
                {
                    columns.Bound(m => m.TicketID).Visible(false);
                    columns.Bound(m => m.TicketNumber);
                    columns.Bound(m => m.TicketTypeName);
                    columns.Bound(m => m.Name);
                    columns.Bound(m => m.Status);
                    columns.Bound(m => m.Severity);
                    columns.Bound(m => m.DaysOpened);
                    columns.Bound(m => m.DateCreated).ClientTemplate("#= kendo.format('{0:d}', kendo.parseDate(DateCreated))#");
                    columns.Bound(m => m.TicketNumber).ClientTemplate("<img title='Add comment' src='" + Url.Content("~/Images/icon_edit.png") + "' onclick=\"location.href='" + Url.Action("AddTicket", "Support", new { ticketId = "#= TicketID #" }) + "'\"/>&nbsp;&nbsp;&nbsp;").Title("").Sortable(false).HtmlAttributes(new { @class = "action-buttons" });
                })
.....
        }
    </div>

    <script id="template" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<ActionModel>()
            .Name("ticketsList_#=TicketID#")
            .Columns(columns =>
            {
                columns.Bound(o => o.ActionID);
                columns.Bound(o => o.Description);
                columns.Bound(o => o.Name);
                columns.Bound(o => o.Status);
                columns.Bound(o => o.AttachmentId).ClientTemplate(
                    "# if (o.AttachmentId != null) { #" +
                        "<img title='Download Attachment' src='" + Url.Content("~/Images/Attach.png") + "' onclick=\"location.href='" + Url.Action("AddTicket", "Support", new { ticketId = "#= o.AttachmentId #" }) + "'/>" +
                        "# } #").Title("").Sortable(false).HtmlAttributes(new { @class = "action-buttons" });
            })
......
    )
    </script>
The conditional from the 2nd grid is not working.. if I use the following condition "# if (AttachmentId != null) { #"  i get a javascript error in page that AttachmentId is not defined.

Could you help me please with this one?

Thank you,
Oana





Dimo
Telerik team
 answered on 01 Jun 2016
3 answers
1.5K+ views

I have a custom Edit template working with a grid in that when I show the grid and click the "Edit" button it shows the popup with the data.  I can edit the data and choose the "Update" button and the popup closes.  I can click the "Edit" button again and the popup shows with the modified data.  So far so good.

 

But two things are happening that are not good.  If I click the "Cancel" button I get the following error:

Unhandled exception at line 27, column 1898 in http://localhost:51277/Scripts/kendo/2016.1.18/kendo.all.min.js
0x800a138f - JavaScript runtime error: Unable to get property 'uid' of undefined or null reference

 

Also the data from the Popup is not populating the underlying row visually in the grid.  The popup only has a few of the columns in the grid row but again they remain empty when the popup closes.  When the popup shows again if you again click the "Edit" button the data is in the fields.

 

I have this at the top of the custom editor template which is the unique ID for the row.

@Html.HiddenFor(model => model.strNotificationSubscriptionSeq)

The following code is in place in the Grid markup:

.Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("NotificationSubscriptionEditor"))

The Datasource in the grid defines the update method on the controller:

.DataSource(dataSource => dataSource
                      .Ajax()
                      .Model(model => { model.Id(p => p.strNotificationSubscriptionSeq); })
                      .Batch(true)
                      .PageSize(25)
                      .ServerOperation(false)
                      .Events(events => events.Error("error_handler"))
                         .Update("NMSubscriptionUpdate", "NotificationMgr")
                   
                  )

 

One thing to note is that the spec for the main template that contains the grid is to do a batch update for all the rows in grid that are modified.  I have that concept working in other templates which send the JSON to the controller.  All that is working fine but I mention the spec here to state that the controller method does nothing on the backend and just returns the data row item sent into the controller.  When the user clicks the master "Save" button I will post the data to the database.

Here is the controller method:

public ActionResult NMSubscriptionUpdate([DataSourceRequest] DataSourceRequest request,[Bind(Prefix = "models")] GridNotificationSubscriptionDataItem gridNMSubscription)
{
   return Json(gridNMSubscription, JsonRequestBehavior.AllowGet);
}

 

Does someone have a suggestion as to what is going wrong here?  Do I need some JavaScript in the Editor template or the parent main Razor view?

Thanks!

Reid

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Dimiter Topalov
Telerik team
 answered on 01 Jun 2016
1 answer
293 views

My json data for this cells is String i.e. :  "05:20"   {HH:mm} format.

Here is my grid options for this column:

column ...  { title: 'Jazdy', field: 'driving_time', footerTemplate: "#= data.driving_time.sum #"}

aggregate ... { field: "driving_time", aggregate: "sum" }

schema ... model: { fields: { driving_time: { type: "duration" }, ...} ...}

So in this scenario in footer i see value only from last row. How to make it properly to get summary duration in footer?

Georgi Krustev
Telerik team
 answered on 01 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?