Telerik Forums
UI for ASP.NET MVC Forum
4 answers
102 views

My dialog has no buttons... Well not really, they're there but they're white.  White button, white text... They don;t show up until I hover over one of them.  What styles or classes do I need to edit to get my dialog buttons to show up?

 

Joe
Top achievements
Rank 1
 answered on 23 Mar 2017
5 answers
455 views

Hello,

If I use kendoValidator in a grid Editor template the error is shown in a tooltip over the field - if I use
a "normal" view the kendoValidator error is shown under the field (see attached Pictures)

  • how to have the same "Tooltip" error in a "normal" form the same as in the grid template?

robert

Viktor Tachev
Telerik team
 answered on 23 Mar 2017
1 answer
159 views
How to reproduce.

 

Have a Grid setup,

Use Template like this.

.Editable(e => e.Mode(GridEditMode.PopUp).TemplateName("Example"))

Inside Example Template

Get something like this to the bottom of the page other than your normal input:

<script>
    $(document).ready(function () {
        setTimeout(function () {
            // comments that will cause problem
            if ($("#hideClassId").val() > 0) {
                $("#tClassId").hide();
                $("#tClass").show();
            }
        });
    });
 
    // comments that can cause problem
    $("input#IsActive").on('change', function () {
        $('#ActiveWaiting').prop('checked', false);
    });
 
    // comments that can cause problem
    $('#ActiveWaiting').on('change', function () {
        $("input#IsActive").prop('checked', false);
    });
</script>

 

Then the popup would freeze.
This is what the error would look like in the console.

Uncaught SyntaxError: Unexpected end of input
    at eval (<anonymous>)
    at Function.globalEval (https://kendo.cdn.telerik.com/2017.1.223/js/jquery.min.js:2:2662)
    at n.fn.init.append (https://kendo.cdn.telerik.com/2017.1.223/js/jquery.min.js:3:22791)
    at M.fn.init.n.fn.(anonymous function) [as appendTo] (https://kendo.cdn.telerik.com/2017.1.223/js/jquery.min.js:3:24510)
    at init._createPopupEditor (https://kendo.cdn.telerik.com/2017.1.223/js/kendo.all.min.js:49:21766)
    at HTMLAnchorElement.<anonymous> (https://kendo.cdn.telerik.com/2017.1.223/js/kendo.all.min.js:49:27635)
Stefan
Telerik team
 answered on 23 Mar 2017
1 answer
223 views

I have table in database which contains events of a system and these events have severity code and event code. These codes have to be localized, it means the text for the severity and event codes should be taken from resource files.

Here is how we construct data for the grid:

public ActionResult GetEvents([DataSourceRequest] DataSourceRequest request)
{
    IQueryable<SystemEventGridModel> data = SystemEvent.GetSystemEventFromDatabase().Select(systemEvent =>
        new SystemEventGridModel
        {
            Id = systemEvent.Id,
            EventCode = systemEvent.EventCode,
            SeverityCode = systemEvent.SeverityCode,
            Date = systemEvent.Date,
            Node = systemEvent.Node,
            IsActive = systemEvent.IsActive
        });
 
    DataSourceResult dataSourceResult = data.ToDataSourceResult(request);
    foreach (SystemEventGridModel gridModel in dataSourceResult.Data)
    {
        gridModel.EventText = Language.ResourceManager.GetString($"EventText{gridModel.EventCode}");
        gridModel.SeverityText = Language.ResourceManager.GetString($"SeverityText{gridModel.SeverityCode}");
    }
    return Json(dataSourceResult);
}

 

Then in the grid we show the localized text but not the codes:

@(Html.Kendo().Grid<SystemEventGridModel>()
      .Name("SystemEventGrid")
      .Columns(columns =>
      {
          columns.Bound(x => x.Node).Title(Language.SystemEventGridModelTitleNode);
          columns.Bound(x => x.SeverityCode).Title(Language.SystemEventGridModelTitleSeverityText).ClientTemplate("#=SeverityText#").Filterable(x => x.Multi(true).CheckAll(false).ItemTemplate("function(e){return columnFirtalableItemTemplate('SeverityCode', 'SeverityText')}"));
          columns.Bound(x => x.EventCode).Title(Language.SystemEventGridModelTitleEventText).ClientTemplate("#=EventText#");
          columns.Bound(x => x.Date).Title(Language.SystemEventGridModelTitleDate);
          columns.Bound(x => x.IsActive).Title(Language.SystemEventGridModelTitleIsActive);
      })
      .DataSource(binding => binding.Ajax().Read("GetEvents", "Home", null))
      .Sortable()
      .Filterable()
      .Pageable(x => x.Refresh(true)))

 

The problem is that we can't use the standard filtering for the columns (e.g. EventText) which do not existing in database and are taken from different places:

http://imgur.com/a/bcV7i

Is there a way to apply the filtering for the text and search by code from database?

P.S. I attached only the source files (models, views and controllers) for the example code.

Konstantin Dikov
Telerik team
 answered on 23 Mar 2017
4 answers
1.2K+ views

I have a kendo grid which is defined as below

$('#BrowseSchool').kendoGrid({
  columns: [{
    title: 'Name',
    headerAttributes: { "data-field": 'Name', "data-title": 'Name' },
    field: 'Name',
    encoded: true
  }, {
    title: 'City',
    headerAttributes: { "data-field": 'City', "data-title": 'City' },
    field: 'City',
    encoded: true
  }, {
    title: 'State',
    headerAttributes: { "data-field": 'State', "data-title": 'State' },
    field: 'State',
    encoded: true
  }, {
    title: 'Zip',
    headerAttributes: { "data-field": 'Zip', "data-title": 'Zip' },
    field: 'Zip',
    encoded: true
  }],
  pageable: {
    buttonCount: 10
  },
  sortable: true,
  selectable: 'Single, Row',
  filterable: true,
  scrollable: {
    height: '200px'
  },
  messages: {
    noRecords: 'No records available.'
 
  },
  dataSource: {
    type: (function() {
      if (kendo.data.transports['aspnetmvc-ajax']) {
        return 'aspnetmvc-ajax';
      } else {
        throw new Error('The kendo.aspnetmvc.min.js script is not included.');
      }
    })(),
    transport: {
      read: {
        url: '/Student/Student_Read'
      },
      prefix: ''
    },
    pageSize: 10,
    page: 1,
    total: 0,
    serverPaging: true,
    serverSorting: true,
    serverFiltering: true,
    serverGrouping: true,
    serverAggregates: true,
    filter: [],
    schema: {
      data: 'Data',
      total: 'Total',
      errors: 'Errors',
      model: {
        fields: {
           Address1: { type: 'string' },
           Name:     { type: 'string' },
           City:     { type: 'string' },                                       
           State:    { type: 'string' },
           Zip:      { type: 'string' }
          }
        }
      }
    }
  }
});

 

I have a div tag defined as below in my view, where the grid is loaded.

<div id="BrowseSchool" class="browse"></div>

 

Now I want that if there are no records returned by the Kendo grid when a filter is applied, I want to hide my div inside which kendo grid loads and show a different div.
I have tried adding databound event to my grid like below:

databound: function (e) {
  alert("No Data");
  //var grid = $("#BrowseSchool").data("kendoGrid");
  //if (grid.dataSource.total() == 0) {
  //  alert("No Data");
  //  $("#BrowseSchool").hide();
  //}
},

 

But, this doesn't seem to be working, as I didn't get the alert box.
My question is, how can I hide a div if there are no records returned by the kendo grid when a filter is applied?

Thanks in advance!

Stefan
Telerik team
 answered on 23 Mar 2017
1 answer
3.7K+ views

Is there any classes I can add to a button to change the styling similar to bootstrap's "btn-danger"?

For buttons that do potentially dangerous things, I would like to add special styling to them but not have to worry about if the text color will be correct. Currently there is the "Primary" attribute, but it'd be great if there were other categories.

 

I understand adding features like that isn't easy to do quickly, but if there are any classes I can add to a normal kendo button to change color and style that's be great!

 

Ivan Danchev
Telerik team
 answered on 23 Mar 2017
1 answer
129 views

Hi All,

I need to display the filter criteria used by a user for a kendoUI grid. Is there any built in way to display this info?
If not, how can I access the those values (like value in search textbox, greater than, less than condition values etc).

Viktor Tachev
Telerik team
 answered on 22 Mar 2017
3 answers
1.1K+ views
I have a form that isn't inside of an HTML form tag, and upon a specific button click, I gather up the form data, bundle it up as a JSON object, send to an MVC controller and get the results back via Ajax. Can I still use the Telerik Validator component, and if so, how?  Are there any examples of using it via Ajax versus a form submission?
Tsvetina
Telerik team
 answered on 22 Mar 2017
1 answer
1.9K+ views

Hi Telerik Team,

I am having telerik MVC kendo grid(server side grid), In the grid I have defined databinding event. In databinding I want to call web api and alter grid's underline items based on that, and want grid to take updated items and display in grid. mainly want grid to wait for ajax complete before invoking it's databound event. plz share how to achieve that.

Please find the code snippet below,

 @(Html.Kendo().Grid<Model>()
        .Name("grdResults")
    .Columns(columns =>
    {
        columns.Bound(e => e.Title).Title("Title").Width(300);
        columns.Bound(e => e.resources).Encoded(false).Width(100).Title("Resource").Sortable(false);       
    })
           
                           .Scrollable()
                           .DataSource(dataSource => dataSource
                           .Custom()
                           .Schema(sch =>
                           {
                               sch.Model(m =>
                               {
                                   m.Id("field1");
                                   m.Field(f => f.field1).Editable(false);
                               });
                           })
                           .Type("odata-v4")
                           .Transport(transport =>
                           {
                               transport.Read(read => read.Url(odataurl)
                                   .DataType("json")
                                   );

                           })
                           .PageSize(10)
                           .ServerPaging(true)
                           .ServerSorting(true)
            //.ServerFiltering(true)

    )
            .Sortable()
            .Pageable()           
            .Events(e => e.DataBinding("onDataBinding"))        
)

<script>

function onDataBinding(arg) {

//Making ajax call here and and changing the arg.items value for a particular column,but value is not getting updated in the grid 

Note: I am able to update the grid column value when I make async: false in ajax call

}

</script>

 

Thanks,

Prathibha

 

Alex Hajigeorgieva
Telerik team
 answered on 22 Mar 2017
1 answer
117 views
Hi All,

I am trying to submit one form having a grid in it. only example/demo so far which fits my needs is below:
sample used for posting form with grid
 
On top of that i did some small change and i am getting an issue.
Issue: 
The above given sample works fine and i can see that what ever changes were made to grid at client side, those all get posted to server when save is clicked.
but if i enable popup editing in grid, then none of items of grid data contains information on whether they were newly added or updated, same time deleted items are not coming in grid's destroyed list.

Please find attached sample(with said issue) which is exact same copy as sample with below changes:

1. enabled editing sing popup editor
2. using custom popup editor - named orderdetails

With this when i click on save, senddata js function is called but all array items which are sent to server in save ajax call are empty list. when i debugged i can see they are all empty as i am not getting dirty/isnew() giving true for added/edited rows. also grid.dataSource._destroyed.length is also 0, even after deleting few rows from grid.

Please help me solve this issue in this sample. Thanks.

Other more related query but not an issue:
In sample which i referred, list is maintained in static variable in controller, but i can't use static as that way it will be same list for all my users,
so wanted to know is there any built in support in grid where in i can just have read of datasource defined to read from db(controller action) on first load,
and then further add/update/delete happens at client side only and still it shall allow me to have popup editing enabled?
Note: I don't want to use session as unsaved data might be huge.

I am asking this as i understand if i remove update action from data source, then i can't enable editing, else grid throws error saying update is must to enable editing.
Konstantin Dikov
Telerik team
 answered on 22 Mar 2017
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
Security
ColorPicker
DateRangePicker
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
DropDownButton
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?