Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decorator function : How to pass arguments to this. #416

Open
neeush opened this issue Jun 16, 2017 · 1 comment
Open

Decorator function : How to pass arguments to this. #416

neeush opened this issue Jun 16, 2017 · 1 comment

Comments

@neeush
Copy link

neeush commented Jun 16, 2017

Hi All,

decorator function doesnot take an input usually sa below
decorator: function(){
return [
'<span data-dojo-type="dijit.form.CheckBox" ',
'data-dojo-attach-point="cb" ',
'data-dojo-props="readOnly: true"',
'>'
].join('');
},

but have seen that in some cases decorator function takes arguments example as below

decorator: function(cellData){
return "" + cellData + "";
}.

How can we achieve this i.e. to make the decorator method accept valid arguments.

@neeush neeush changed the title Decorator function : How to pass parameters to this. Decorator function : How to pass arguments to this. Jun 16, 2017
@neeush
Copy link
Author

neeush commented Jun 19, 2017

One more example .....I am getting the problem is
data,rowId & rowIndex are coming undefined....

{ 'name': 'birth day',
'field': 'birthday',
'width': '30px',
widgetsInCell: true,
decorator: function (data, rowId, rowIndex ){
console.log(data);
console.log(rowId);
console.log(rowIndex);

								return "<img onclick='window.hello()'        src='images/notification.png' alt='notification icon' width='32px' height='32px'>";
                          
								}
            				};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant