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

Error when specifying width with ColumnResizer and ColumnSet #1358

Open
mwistrand opened this issue Mar 15, 2017 · 1 comment
Open

Error when specifying width with ColumnResizer and ColumnSet #1358

mwistrand opened this issue Mar 15, 2017 · 1 comment

Comments

@mwistrand
Copy link
Member

When initializing a grid that mixes in both dgrid/ColumnSet and dgrid/extensions/ColumnResizer, specifying a width property on any column definition object results in an error being thrown from ColumnResizer.js: Uncaught TypeError: Cannot read property '0-0-1' of undefined.

The following grid generates the exact error message displayed above.

require([
	'dojo/_base/declare',
	'dgrid/OnDemandGrid',
	'dgrid/ColumnSet',
	'dgrid/extensions/ColumnResizer',
	'dstore/Memory'
], function (declare, OnDemandGrid, ColumnSet, ColumnResizer, Memory) {
	var Grid = declare([ OnDemandGrid, ColumnResizer, ColumnSet ]);
	var data = [];
	for (var i = 0; i < 1000; i++) {
		data.push({ id: i, name: 'Item' + i });
	}
	new Grid({
		collection: new Memory({ data: data }),
		columnSets: [
			[
				[
					{ field: 'id', label: 'ID' },
					{ field: 'name', label: 'Name', width: 300 }
				]
			]
		]
	}, 'grid').startup();
});
@07shawk
Copy link

07shawk commented Dec 6, 2017

Change the width in your css file.

Example:
.yourClassNameForGrid .field-name {
width: 900px;
}

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

2 participants