I am a little late on this, but for anyone searching similar answer – in first example, I would say you did not define cwraggDataSource
attribute properly (you did not provide block definition code). When attribute is not defined properly, it is initialized to undefined.
As for the second example, you were trying to call setAttributes in event function, and in it setAttributes is out of scope.
Related Posts:
- lodash dependency in a Gutenberg plugin
- creating elements/innerblocks via rangecontrol
- Looking for callback function after Gutenberg is rendered?
- Gutenberg: useDispatch is not a function – @wordpress/data included
- Make a list with header and subtext in Gutenberg blocks
- Gutenberg – What is the best way to save/update post meta?
- How to prevent UNDO on guternberg block editor
- Do I have to worry about useState causing a re-render?
- Creating a custom Gutenberg block with columns
- Gutenberg: import dependency or assign from global variable?
- How to control an elements classes from multiple Gutenberg sidebar controls?
- Developing the save function in Gutenberg blocks
- Gutenberg – is it ok to load dependencies multiple times?
- Preventing double loading JS scripts (like React) when developing for Gutenberg
- Getting incorrect filepath inside custom block front-end output using @wordpress/create-block tutorial
- Trigger function on Remove block or add new block in Gutenberg JavaScript
- Rerender core Templates with with ToggleControl but it doesnt recognize block type
- HTMLCollection not counting right in editor? / for loop not working on elements in DOM
- What happens/fires when you select a block in the editor?
- Is “document loaded” different on admin side than public side?
- why is apiFetch throwing Unhandled Promise Rejection: TypeError: Object is not a function
- Reading plugin settings in esnext wordpress block
- How can i add insertion point between inner blocks in my custom block like core blocks
- Reinitiate Gutenburg’s blocks using javascript
- How can you check if you are in a particular page in the WP Admin section? For example how can I check if I am in the Users > Your Profile page?
- How to implement color picker from wordpress in my plugin?
- Add async script
- API to trigger prompt on leaving page
- Test to see if jQuery or Prototype is queued by another plugin?
- jQuery in header or footer
- Using Primary Color in Plugin Block
- Gutenberg Blocks doesn’t render correctly when using do_blocks
- How to Add a .js file Only in one specific Page Dynamically to Head
- How to prevent loading of all plugin’s resources?
- How to trap “Publish” button to check for meta box validation?
- Pass javascript result to shortcode executer function
- Plugin Sidebar is not Saving Meta Attribute to Post/Page after “Update”
- Use js script from one plugin in another plugin
- What’s the Right Way to get and save remote data for a Gutenberg block?
- WordPress: After Gutenberg plugin migration to block.json the localization/ translations with PolyGlot in JavaScript does not work anymore
- Making a custom widget that includes a tinymce and works in Site Origin Page Builder
- What’s the better way to add an inline script?
- Is there a better way to implement responsive images than what WordPress uses by default?
- Gutenberg Block add element in the Editor inside InnerBlocks after div – editor-block-list
- Prevent Javascript Facebook SDK Conflicts in plugin
- how to include javascript file and css file in wordpress
- How do you render_callback for register_block_type to a method in another class?
- How insert negative values in Gutenberg box-control
- Why is my javascript not invoked in my hooks except wp_head?
- Are block templates incompatible with serialize_blocks?
- ServerSideRender and Media Object: attributes passing image data object to php renderer even though it’s not set
- WordPress Block Development – trouble importing from @wordpress/icons
- Is there an event or an other method that tells me the preview is loaded?
- How to access noticeOperations from withNotices
- How to insert text at the current cursor position in Gutenberg?
- How to get boolean value from register_meta properly?
- jQuery selectors for editor elements safe to use?
- There is a problem in the gutenberg block I developed. Problem is with withInstanceId
- My WordPress plugin cannot load my JavaScript file
- javascript datatables in a plugin
- Inserting code to HTML view from a pop up initiated from visual view
- Plugin – Make sure jquery is loaded in my settings page plus my JS file
- Proper way to use useSelect
- Passing the name of selected color from the custom component to `render_callback`
- How to save post meta as an array in Gutenberg?
- Need help about understand api, wp, $ syntax in WordPress plugin script
- WordPress Gutenberg InnerBlocks renderAppender not showing with template
- Referencing files in JavaScript in WordPress Plugin
- How to insert HTML/CSS/JS into my iframe plugin?
- Is there a WordPress plugin to design WebGL? [closed]
- How to write a shopping queue line plugin with a queue button?
- Console errors in 6.0-RC1 Widget screen
- How to use attributes in competent of Gutenberg
- var(–text-color) in style.scss works once but not twitch
- wordpress full site editing problem when extending core blocks
- Pass custom props to
- wp.media gallery collection sometimes undefined
- Get value of custom checkbox from Gutenberg sidebar in plugin
- Dynamically modify content added to table via javascript
- XMLHttpRequest to open PHP file responds with Missing Page
- Javascript scroll eventHandler only working when I’m logged in in WordPress
- Replace the WordPress Media Library Uploader
- Pass javascript result to shortcode executer function
- Add language localisation to javascript alert?
- How to display archive by selecting year and then selecting month
- How do I use (or mimic) document.getElementById() on a page loaded from WordPress database?
- Custom plugin not appearing
- Gutenberg’s Popover component position relative to the focused element
- How do I access the contents of WordPress Classic editor in admin area with JavaScript?
- Gutenberg: – Call a function after Server Side Component is rendered
- Accept only PDF file for upload
- get the queried_object of an url
- Help interpreting @wordpress/create-block-tutorial-template usage error
- Call API on post save/update and show the result in admin area
- How to get custom user meta by id in custom Gutenberg block
- Block Development: hamburger module throwing error in save function
- Adding a navigation with wp_nav_menu() to a custom block in the site editor
- Why isn’t custom sidebar panel not showing up in the Gutenberg Editor?
- Vanilla javascript in custom gutenberg block not working
- How can I include React useState in a custom gutenberg block plugin?