Telerik Forums
Kendo UI for jQuery Forum
1 answer
55 views
Hello,

Im trying to create a custome filter but this never pass to my controller some field that have the filter name

I create a function that initialize the Grid
function KendoUIGrid(config)
{
    var grid = $("#" + config.id);
 
    grid.kendoGrid({
        columns: config.columns,
        dataSource: {
            transport: {
                read: {
                    url: config.url,
                    dataType: "JSON",
                    type: "POST",
                    data: {
                        action: 'read'
                    }
                },
                //destroy: {
                //    url: config.url,
                //    dataType: "JSON",
                //    type: "POST",
                //    data: {
                //        action: 'destroy'
                //    }
                //},
                //update: {
                //    url: config.url,
                //    dataType: "JSON",
                //    type: "POST",
                //    data: {
                //        action: 'update'
                //    }
                //},
                //create: {
                //    url: config.url,
                //    dataType: "JSON",
                //    type: "POST",
                //    data: {
                //        action: 'create'
                //    }
                //},
                parameterMap: function (options) {
                    var result = {
                        page: options.page,
                        pageSize: options.pageSize,
                        skip: options.skip,
                        orderBy: '',
                        take: options.take,
                        pi: options.page == 1 ? 1 : options.skip + 1,
                        pf: options.skip + options.take,
                        action: options.action
                    };
 
                    if (options.sort != undefined) {
                        if (options.sort[0] != undefined) {
                            result.orderBy = options.sort != undefined ? options.sort[0]['field'] + ' ' + options.sort[0]['dir'] : '';
                        } else {
                            result.orderBy = 1;
                        }
                    }
 
                    return result;
                }
            },
            schema: {
                total: "total",
                data: "data"
            },
            pageSize: 15,
            serverSorting: true,
            serverPaging: true,
            severFiltering: true
        },
        sortable: true,
        resizable: true,
        pageable: {
            numeric: false,
            input: true
        },
        selectable: true
    });
Its ok, work fine but i can send filters ... my logic is create a filter and under the filter show the grid
I have this HTML

<h2>Proveedores</h2>
<div class="box k-shadow">
    <div id="grid">
        <div class="k-block">
            <div class="k-header">Filtro de búsqueda</div>
            <table>
                <tr>
                    <td>
                        <input type="text" name="nombre" placeholder="Ingrese el nombre del proveedor" class="k-textbox" />
                    </td>
                    <td style="width:100px;">
                        <select>
                            <option>Activo</option>
                            <option>Inactivo</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <button class="k-button">Limpiar</button>
                        <button id="btnFiltrar" class="k-button">Filtrar</button>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</div
And for initialize the grid i only need to use this
$(document).ready(function () {
    var config =
    {
        id: 'grid',
        url: BaseUrl('mantenimiento/ProveedorGrid'),
        columns: [
            { field: "id", title: "id", width: 50, hidden: true },
            { field: "nombre", title: "Nombre" },
            {
                command:
                [
                    {template: KendoUILinkButton(BaseUrl('mantenimiento/proveedor'), 'edit')},
                    {template: KendoUILinkButton(BaseUrl('mantenimiento/ProveedorGrid'), 'delete')}
                ],
                width: 88
            }
        ]
    };
 
    KendoUIGrid(config);
 
    $("#btnFiltrar").click(function () {
        $("#grid")
            .data("kendoGrid")
            .dataSource.filter({
                filters: [
                  { field: "nombre", operator: "startswith", value: "Paul" }
                ]
            });
    })
})
Atanas Korchev
Telerik team
 answered on 01 May 2013
3 answers
82 views
Hello,
I am attempting to have a listview that when a list item is licked, a modal window pops up with more of the objects details inside. 
Currently, I have a onclick function that successfully accesses the correct object. My question however is, how do I access the object then inside the modal view?

Here is a JSFiddle with a snippet of my code

I have found this question previously, however it has provided me with little guidance on what the solution actually was. 
Petyo
Telerik team
 answered on 01 May 2013
2 answers
190 views
The backbutton widget for Kendo Mobile version 2013.1.319 renders poorly on Android mobile browsers and PhoneGap webviews (borders extend beyond left arrow) when the platform is forced as iOS.

var app = new kendo.mobile.Application(document.body, { transition: "slide:left", platform: "ios"});

Are there any .km-ios6 .km-back css overrides that will fix this?
Brandon Peterson
Top achievements
Rank 2
 answered on 01 May 2013
7 answers
385 views
Dear all,

Is it possible to translate your kendo.ui grid, for example this message : 'Drag a column header and drop it here to group by that column' or 'Show items with value that:', etc ...

otherwise is it planned and when ?

Thanks and Regards,
Arnaud Viscusi
emidio rana
Top achievements
Rank 1
 answered on 30 Apr 2013
10 answers
443 views
Hi,
 
I am doing a quick investigation regarding the saving of a controls state. Mainly a Grid control.
 
What i am after is information about a user changing the column order, sort order, hiding/showing columns, etc. And then having these changes saved somewhere (locally most likely) so when they return to the page, these changes persist.
 
Thanks for your help.
 
Simon Gould
Steve
Top achievements
Rank 1
 answered on 30 Apr 2013
3 answers
543 views
Is there a way to show / hide the Loading-Animation by Javascript Code?

And by the way, if I load remote-data by the init-Function of a listview, the loading-Animation does not come up.
Here my code:

function mobileListViewTemplatesInit() {
        $("#termin-listview").kendoMobileListView({
            dataSource: kendo.data.DataSource.create({ transport: { read: { url: urlTermine, dataType: "json",
            data: {
                gn: id
            }} }, group: "Datum" }),
            template: $("#customListViewTemplate").html(),
            headerTemplate: "<h2 class='termin-title'>Termine am ${value}</h2>"
        });
    }


emidio rana
Top achievements
Rank 1
 answered on 30 Apr 2013
0 answers
80 views
Hi,

I have the following requirement to implement.

1. My grid should look like as attached image,
2. it contains two rows
3. from column 2, the no of columns varies  based on the no of weeks in a month (ex: 3 weeks in a month, then 3 column and 6 sub columns )
4. second row data should be fetched from the database using controller and model where my entity class is present
5. first row is empty initially as shown, and also  the first sub-column("input value") of each column should be made editable and based on the value entered, second sub-column and the column 1, should be updated based on the formula shown in screen shot attached
6.column 1 and second sub-column  of each column should be read only
7.  entire second row should be read only

For clear understanding, i am attaching an excel sheet where the first row requirement been achieved.
 

Regards,
Shashi
Shashi
Top achievements
Rank 1
 asked on 30 Apr 2013
3 answers
165 views
Hello,

I've got a fairly simple grid implementation (ASP.NET MVC) which uses the Grid and a dynamically bound data source. When I debug the project, I get the following exception: Any assistance would be greatly appreciated.

Unhandled exception at line 9, column 25731 in
http://localhost:11499/Scripts/kendo/2013.1.319/kendo.all.min.js0x800a03ec -
JavaScript runtime error: Expected ';'


Here's the implementation of the grid in the index.cshtml:

@(Html.Kendo().Grid(Model)<BR> .Name("Grid")<BR> .Columns(columns =><BR>
{<BR>foreach (System.Data.DataColumn column in Model.Columns)<BR> {<BR> if
(column.ColumnName !=
"Id")<BR>columns.Bound(column.ColumnName).Groupable(true);<BR> }<BR> })<BR>
.Pageable()<BR> .Sortable()<BR> .Scrollable()<BR> .Filterable()<BR>
.Groupable()<BR> .ColumnMenu()<BR> .DataSource(dataSource => dataSource<BR>
.Ajax()<BR> .Model(model =><BR> {<BR>foreach (System.Data.DataColumn column
in Model.Columns)<BR> {<BR> if(column.ColumnName !=
"Id")<BR>model.Field(column.ColumnName, column.DataType);<BR> } <BR> })<BR>
.Read(read => read.Action("Read", "Home"))<BR> .PageSize(20)<BR> )<BR>)<BR>
Jayesh Goyani
Top achievements
Rank 2
 answered on 30 Apr 2013
2 answers
277 views
I can not get my grid to scroll horizontally at all. I'm using the MVC wrapper and have the following code:

@(
Html.Kendo()
    .Grid<MyModel>
    .Name("grid")
    .DataSource(…)
    .Scrollable()
    .Columns(columns =>
    {
        columns.Bound(…).Width(300);
        columns.Bound(…).Width(200);
        columns.Bound(…).Width(300);
        columns.Bound(…).Width(200);
        columns.Bound(…).Width(200);
        columns.Bound(…).Width(500);
    })
)

This results in a table that squishes the columns to fit the width of the table, instead of triggering a horizontal scroll bar. The grid's content table has a table-layout of "fixed" with a width of 100%. The problem seems to be that inside of the generated tables is a nested colgroup. Instead of:
<table><colgroup><col /><col /></colgroup>...</table>
I see 
<table><colgroup><colgroup><col /><col /></colgroup></colgroup>...</table>
What could be causing this? I'm using the latest version (2013.1.319). What's interesting is that this only appears in how the colgroup is parsed and rendered by the browser. The actual source only has the single colgroup element. Check out the attached screenshot to see what Firebug displays versus the source. There is a difference between what I see in "View Source" and "View Generated Source".

Just a guess, but is the kendoGrid jQuery call adding an additional colgroup? It seems the MVC helper is already building a table with it.


Brian Vallelunga
Top achievements
Rank 1
 answered on 30 Apr 2013
3 answers
229 views
HI,
I am trying to display json data in mobile listview which is returned by asmx webservice. The code for the webservice is:
//Employee class
public class Employee
    {
    public int ID { get; set; }
    public string Name { get; set; }
    public string Company { get; set; }
    public string Address { get; set; }
    public string Phone { get; set; }
    public string Country { get; set; }
}
 [WebService(Namespace = "http://viper.nl")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]   
    [System.Web.Script.Services.ScriptService]
    public class ViperServices : System.Web.Services.WebService
    {
[WebMethod]
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
        public string TestJSON()
        {
            Employee[] e = new Employee[2];
            e[0] = new Employee();
           
 e[0].ID="1001";
   e[0].Name = "Ajay Singh";
            e[0].Company = "Birlasoft Ltd.";
            e[0].Address = "LosAngeles California";
            e[0].Phone = "1204675";
            e[0].Country = "US";             
            e[1] = new Employee(); 
    e[1].ID="1001";  
            e[1].Name = "Ajay Singh";
            e[1].Company = "Birlasoft Ltd.";
            e[1].Address = "D-195 Sector Noida";
            e[1].Phone = "1204675";
            e[1].Country = "India";
            return new JavaScriptSerializer().Serialize(e);
        }
  
    }

Code how i tried to use the service and display in mobile list view:
 <script type="text/javascript">
         function EmployeeInit() {
             var ds = new kendo.data.DataSource({
                 schema:{
                    data:"d",
                    model:{
                        id:"ID",
                        fields: {
                            ID:{type:"number"},
                            Name:{type:"string"},
                            }
                        },
                 transport: {
                     read: {
                         type: "POST",
                         url: "../Services/ViperServices.asmx/TestJSON",                      
                         ContentType: "application/json",
                         dataType: "json"
                     }
                 }
             });           

         $("#EmployeeList").kendoMobileListView({
            dataSource: ds,
            template: "#:Name#"
        });
        }
        </script>

//initialize list view
<div data-role="view"  data-init="EmployeeInit " >     
           <ul id="EmployeeList">              
            </ul>        
    </div>


I can see the json data if i invoke the service in brower from visual studio environment. But when i try to display in mobile listview, no data is displaying. 

Can anyone tell me what mistake i made or can you provide me a working example on my scenario?

Thanks,
Shree, 
Petur Subev
Telerik team
 answered on 30 Apr 2013
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
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
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
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
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?