Telerik Forums
Kendo UI for jQuery Forum
2 answers
224 views
if I have only two or more field editable in a row, when i click on a uneditable field this vanishes.

just attached a snapshot:


this is my grid declaration:

        $(function() {
            $("#grid").kendoGrid({
                pageable: true,
                dataSource: {
                    type: "json",
                    serverPaging: true,
                    serverSorting: true,
                    transport: {
                        read: "?module=<?=$_REQUEST["module"]?>&applettype=kserver&mode=action&q=2"    ,
                    },
                    schema: {
                        data: "data",
                        total: "total",
                        model: {
                            id: "id",
                            fields: {
                                NAME: { editable: true },
                                STATUS: { editable: true },
                                UPDATED: { editable: true },
                            }
                        }
                    },
                    pageSize: <?=$ROW_LIMIT?>,
                    serverPaging: true,
                    error: function(e) {
                        alert(e.responseText);
                    },
                    //sort: { field: "CREATED", dir: "asc" },
                },
                editable: true,
                //navigable: true,
                selectable: true,
                //scrollable: true,
                sortable: {
                    mode: "single", // enables multi-column sorting
                    allowUnsort: true
                },              
                columns: [
                              { title: "<?=$LBL_ACTIVITIES_FIELD_CREATED;?>",field: "CREATED" },
                              { title: "<?=$LBL_ACTIVITIES_FIELD_NAME;?>",field: "NAME" },
                              { title: "<?=$LBL_ACTIVITIES_FIELD_AREA;?>",field: "AREA" },
                              { title: "<?=$LBL_ACTIVITIES_FIELD_STATUS;?>",field: "STATUS" },
                              { title: "<?=$LBL_ACTIVITIES_FIELD_PRIORITY;?>",field: "PRIORITY" },
                              { title: "<?=$LBL_ACTIVITIES_FIELD_RECURSE_SAVE;?>",field: "RECURSE_SAVE" },
                              { title: "<?=$LBL_ACTIVITIES_FIELD_PR_GRP_NAME;?>",field: "PR_GRP_NAME" },
                              { title: "<?=$LBL_ACTIVITIES_FIELD_OWNER_NAME;?>",field: "OWNER_NAME" },
                              { title: "<?=$LBL_ACTIVITIES_FIELD_EXP_DT;?>",field: "EXP_DT" },
                              { title: "<?=$LBL_ACTIVITIES_FIELD_UPDATED;?>",field: "UPDATED" }
                          ],
                    
                toolbar: [ "save", "cancel","destroy","create" ]  // adds save and cancel buttons
            });

        });

thanks
Giulio
Giulio
Top achievements
Rank 1
 answered on 07 Feb 2012
1 answer
119 views
Hi,

Let us say I have a dataSource with 2 columns: Name and Contact.
Now I have a searchValue on which I want to filter the dataSource with this expression: "Name == searchValue || Contact == searchValue".
How should I do that? Can't find documentation on that, only about simpel single field filters.
I use this to filter on one field:
dataSource.query({ filter: { field: "Name", operator: "contains", value: searchValue} }); 

But how should I do that with an "or" filter on a second field?
And is possible to use an expression?

Regards, Jaap
Rosen
Telerik team
 answered on 07 Feb 2012
1 answer
108 views
Hi,

So every once in a while I'll be look at the site I created and it just scroll to the bottom of the screen and you can't scroll up or down to see where it went to?  it's just missing.  I can't recreate it but it happens often.  Has anyone else see this?
Petyo
Telerik team
 answered on 07 Feb 2012
8 answers
3.1K+ views
Hi,

Is it possible to implement following scenario using KendoUI Grid or upcoming ListView widget?

Main grid (Show all rows from Groups tabe)

ID   Name           Members
1    Group 1        SubGrid (Show rows from Members table where Members.GroupID=Current row's GroupID)
2    Group 2        SubGrid (show members in group 2)
3    Group 3        SubGrid (show members in group 3)
...

BR
Marko
Ilyas
Top achievements
Rank 1
 answered on 07 Feb 2012
2 answers
2.3K+ views
How do we format number with , as thousand separator?
e.g 10,000,000

thanks,
Bahri
Top achievements
Rank 1
 answered on 07 Feb 2012
7 answers
193 views

I have a "cell editable grid" with save a button on top of the header, when cell changed will triger save action, here is what I am experiencing

the grid able to update itself when the field is clean
{ field: "Inventory", title: "Inv Jan", width: "80px"}

when add template to the editable fields, then error will popup - "NetworkError: 500 Internal Server Error - http://localhost:9999/Inventory/UpdInventoryData"
{ field: "Inventory", title: "Inv Jan", width: "80px", template: "<div style='color:blue;'>#= Inventory # </div>" },

thanks
Nikolay Rusev
Telerik team
 answered on 07 Feb 2012
3 answers
75 views
Hello,

First and foremost - great to see that Telerik is also providing this set of widgets.  It looks as if we will certainly be interested in purchasing this.

I do have a question though for setting up a datagrid.  

Our widgets are usually set up as html entities that have a specific class assigned to them, and have data attributes that we can interprete in javascript to set up the widget.  this has one major and obvious advantage: we have 1 javascript file we include in the headers that contain ALL initialisation code.

So, our grid would look like this:

<table class="fx-grid"
data-datasource-url="json.php?blablabla"
> <!-- some code can go here still -->
</table>

And in javascript, we usually initialise everything as follows:

$('table.fx-grid').livequery(function() {
$(this)
.removeClass('fx-grid')           // We do this to make sure this widget can only be selected and processed ONCE
.kendoGrid({
// configuration settings go here!
});
});

The major advantage is that when I retrieve a new grid through ajax to be displayed in a tab for instance, that ajax call won't need to send along additional javascript code, and we only need the html (the livequery plugin does just what we need: detect that new widget is added to the dom, and trigger the method...)

As you notice, we would need all settings as data- parameters defined so that in javascript, we can easily interprete them using $(this).attr('data-datasource-url') and pass them along to the kendoGrid feature.

I'm just not sure at this time what the minimal configuration is for setting up a remote datasource, and in what format we need to have json.php return the data.  I've been looking at your examples, but I don't see what the minimal setup is you require.
Rosen
Telerik team
 answered on 07 Feb 2012
1 answer
90 views
Hi,

Is it possible to update the underlying table that feeds a combobox with user entered values? For example, if I have a combobox with a remote binding to a mysql table called colors (id, color columns) , would it be possible to add an update on change when a user adds a color that's not in the table?

In other words, can I add an update to the data source code that adds a record to the table when a user enters a value not in the table? I'm thinking if I add an update transport to the datasourse and tie it to the onchange event that should work?

It would be nice if that were an option when initializing a combobox, like update: true.

Thanks for any help on this.
Georgi Krustev
Telerik team
 answered on 07 Feb 2012
1 answer
382 views
I have a javascript module built already that we use to get data from the server in json format. So in the callback method I have an array of dataItems that I would like to rebind the kendo grid with. But I'm not sure how to do this. Could someone please advise me on this.
Rosen
Telerik team
 answered on 07 Feb 2012
1 answer
307 views
Hi,

I could not find examples for all scenarios, here's where I'm at in the moment:
- read (mysql local database via php) works fine and as expected
- edit/save/delete throws errors

$("#grid").kendoGrid({
    dataSource: {
        transport: {
            read    : { url: "data/product_list.php"   , dataType : "json" } ,
            create  : { url: "data/product_create.php" , type: "POST" } ,
            update  : { url: "data/product_update.php" , type:"POST" } ,
            destroy : { url: "data/product_delete.php" , type: "POST" }
        },
        schema: {
            data: "data"
        } ,
        model: {
            id:"ID" ,
            fields : {
                ID : {
                    editable : false,
                    nullable : true } ,
                product_name : {
                    editable : false ,
                    nullable: true } ,
                name : { required : true } ,
                size : { required : true } ,
                weight : { required : true } ,
                glossy : { required : true } ,
                color : { required : true }
            }
        }
    },
    columns: [{ field: "ID" , title : "id" , width: "2em" } ,
              { field: "product_name" , title : "Product" } ,
              { field: "name" ,   title: "Name" } ,
              { field: "size" ,   title: "Size" } ,
              { field: "weight" , title: "Weight" } ,
              { field: "glossy" , title: "Shining" } ,
              { field: "color" ,  title: "Color" } ,
              { title: "" , command: "destroy" , width: "110px" }
                 ] ,
    toolbar : [ { name: "create" , text : "Add New Product" } , "save" , "cancel" ],
    detailTemplate: kendo.template($("#template").html()),
    detailInit: detailInit,
    sortable : {
        mode : "multiple" ,
        allowUnsort : true } ,
    editable : {
        update : true , destroy : true , confirmation: "really delete it? \n (press 'Save Changes' to delete it from server!)" }
});

Software info
  • Browser: Safari mac os x 5.1.2, Firefox 9.0.1 mac os x 
  • Kendo UI v2011.3.1129
Symptoms
  • grid is displayed correctly, all buttons show up (remove, toolbar)
  • when a) clicking inside a field to edit, b) after saying ok to the confirmation and c) when clicking on the save button, the following error is thrown
  • Safari: TypeError: 'undefined' is not an object (evaluating 'this._set.get') on line 4735
    Firefox: this._set is undefined on line 4735
  • line 4735 is in the uncompressed kendo.all.js (line number is for the a) event, might differ for other events)
  • detailInfo datagrid (not shown in code) is read and displayed correctly. Same erroneous behavior...
Database info
The database/php script is built on the kendo examples, SQL is this:
SELECT `ID` , CONCAT( name, ' ' , size , ' ' , pages , ' ' , weight  , ' ' , glossy , ' ' , color ) AS `product_name` , name , size , pages , weight , glossy , color FROM fp_products;");

  • "product_name" is a server-side-calculated field.
  • all fields are varchars, only ID is integer (no big amounts:)

Questions
  • is there a more complete example for all CRUD grid actions using the LAMP technology (or any other SQL based) stack?
  • any hints/tips about where I am heading in the wrong direction are greatly appreciated!
Many thanx in advance!
Volker
Volker
Top achievements
Rank 1
 answered on 07 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?