Telerik Forums
Kendo UI for jQuery Forum
2 answers
2.4K+ 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
233 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
94 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
127 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
421 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
342 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
0 answers
119 views
My Scenario:

1. I have a Grid with this setting page size:10 and Grid has 40 records (means 4 pages),
2. Then i click on 4th pagination number and  refresh current page
3. Grid pagination number set to first page instead of remain on same pagination number(4th number).

Can i manage this in Kenodo UI Framework?


Thanks in Advance.



Atit
Top achievements
Rank 1
 asked on 07 Feb 2012
2 answers
527 views
I'm trying to figure out how to embed a function in a template with 3+ levels of nested quotes.  It works in one case, but not in another.  

Here is the JSFiddle:  http://jsfiddle.net/ZpCAy/62/

Here is the code:
$("#grid").kendoGrid({
    dataSource{
        type"odata",
        transport{
            read"http://demos.kendoui.com/service/Northwind.svc/Orders"
        },
        schema{
            model{
                id"OrderID"            
            }
        }
    },
    columns["OrderID",
              title"Edit1"template:"<a href='javascript:(function(){window.open(\"www.oracle.com\");})();'>Edit1</a>" },
              title"Edit2"template:"<a href='javascript:(function(){$(\"#win\").kendoWindow();})();'>Edit2</a>" }
             ]
});


(Note that it won't actually run because of the Edit2 line.  But if you remove that, the Edit1 will work)

When I run this in Chrome, I get this:

11Uncaught Error: Invalid template:'<tr data-id="#=this.tmpl0(data)#"><td>${OrderID}</td><td><a href='javascript:(function(){window.open("www.oracle.com");})();'>Edit1</a></td><td><a href='javascript:(function(){$("#win").kendoWindow();})();'>Edit2</a></td></tr>' Generated code:'var o,e=kendo.htmlEncode;with(data){o='<tr data-id="'+(this.tmpl0(data))+'"><td>'+(e(OrderID))+'</td><td><a href=\'javascript:(function(){window.open("www.oracle.com");})();\'>Edit1</a></td><td><a href=\'javascript:(function(){$("';win").kendoWindow();})();'>Edit2</a></td></tr>;o+=;}return o;'

As you can see, the generated code is doing something to the "#win" and converting it to "';win" ... anyone know what's up?
Michael
Top achievements
Rank 1
 answered on 07 Feb 2012
2 answers
701 views
I am using the autocomplete component to interact with an ASMX webservice ... when I "hard code" the value to send as a parameter, it works fine:

      data: {
             sProductDesc: "E" 
      } // data

Data Posted: 
{"sProductDesc":"E","take":10,"skip":0,"page":1,"pageSize":10,"filter":{"logic":"and","filters":[{"field":"GROUP_NAME","operator":"contains","value":"e"}]},"group":[]}
      
but when I try and use the value from the control the parameter is not passed to the webservice:

      data: {
            sProductDesc: function(){return $("#autoComplete").data("kendoAutoComplete").value()} 
      } // data
Data Posted:
{"take":10,"skip":0,"page":1,"pageSize":10,"filter":{"logic":"and","filters":[{"field":"GROUP_NAME","operator":"contains","value":"E"}]},"group":[]}

Any ideas?  
Thanks!
Doug




Doug Riley
Top achievements
Rank 1
 answered on 06 Feb 2012
0 answers
101 views
Hi
I'm trying to put a button into grid. In order to achieve that I wanted to use rowTemplates. However I have a problem with geting and item id and put it into action parameter.
So far I these  constructinos
<script id="rowTemplate" type="text/x-kendo-tmpl">
                <tr>
                    <td>
                    <form action="/Home/EditProduct/?id="+ "#=Id#" class="addEditButton" method="post">
                        <submit type="button" value="Edytuj"/>
                    </form>
                      </td>
                </tr>
    </script>
 
<script id="rowTemplate" type="text/x-kendo-tmpl">
                <tr>
                    <td>
                    <form action="/Home/EditProduct/?id="+ ${ Id } class="addEditButton" method="post">
                        <submit type="button" value="Edytuj"/>
                    </form>
                      </td>
                </tr>
    </script>
 
<script id="rowTemplate" type="text/x-kendo-tmpl">
                <tr>
                    <td>
                    <form action="/Home/EditProduct/?id=${ Id }"  class="addEditButton" method="post">
                        <submit type="button" value="Edytuj"/>
                    </form>
                      </td>
                </tr>
    </script
 
<script id="rowTemplate" type="text/x-kendo-tmpl">
                <tr>
                    <td>
                    <form action="/Home/EditProduct/?id=${ Id }  class="addEditButton" method="post">
                        <submit type="button" value="Edytuj"/>
                    </form>
                      </td>
                </tr>
    </script
However non of this method can successfully retrieve value of id parameter from object bounded to row. Is it possible to somehow pass value of id into action ??
T
Top achievements
Rank 1
 asked on 06 Feb 2012
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
Drag and Drop
Application
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
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?