Sencha Grid Exporter fails when exporting to CSV or any other type other than xlsx? - extjs

I am using Sencha Grid Exporter plugin, while it works perfectly fine when exported to Excel, I cant get it to export to CSV or any other types from my app.
It works fine as listed on the KitchenSink example.
KitchenSink Exporter Example
http://docs.sencha.com/extjs/6.2.1/classic/Ext.grid.plugin.Exporter.html
Ext.getCmp('grid').saveDocumentAs({
type: 'csv', // What other possible values can go here
title: globals.reportName,
fileName: 'myExport.csv'
});
Comes with an error as below:
Uncaught Error: [Ext.createByAlias] Unrecognized alias: exporter.CSV
at Ext.Inventory.instantiateByAlias (app.js?_dc=1481916938387:13520)
at Ext.Factory.create (app.js?_dc=1481916938387:23199)
at constructor.getExporter (app.js?_dc=1481916938387:204593)
at constructor.saveDocumentAs (app.js?_dc=1481916938387:204520)
at constructor.saveDocumentAs (app.js?_dc=1481916938387:5355)
at constructor.onMenuitemClick (app.js?_dc=1481916938387:255332)
at constructor.fire (app.js?_dc=1481916938387:19281)
at constructor.doFireEvent (app.js?_dc=1481916938387:20248)
at constructor.doFireEvent (app.js?_dc=1481916938387:65488)
at constructor.prototype.doFireEvent (app.js?_dc=1481916938387:56438)

You are missing a requires.
If you tell ExtJS to use type:'csv', it will try to instantiate exporter.csv. If you tell ExtJS to use type:'excel', it will try to instantiate exporter.excel. To get that one from the file system, you have to include the fully qualified name somewhere, e.g. in your requires section:
requires:[
'Ext.exporter.text.CSV'
]
The heading in the docs has two parts: First the full qualified class name, which is "Ext.exporter.text.CSV", and then, the short name ("exporter.csv"). If you haven't provided the full name anywhere, the file cannot be loaded, unless the framework itself already requires the exporter by full name. Which it, according to the error message, doesn't.
Background info, before you ask "Why doesn't it?": Since the plugin can work with any of the dozens of exporters, and you wouldn't want to load all just to create one type of export, you have to import the exporter manually.

Related

SvelteKit, import type LayoutServerLoad/PageLoad

In layout.server.ts I try to
import type { LayoutServerLoad } from './$types';
but the type can't be found:
'"./$types"' has no exported member named 'LayoutServerLoad'. Did you mean 'LayoutServerData'?
What do I need to do to get the type LayoutServerLoad (or PageLoad or PageServerLoad ...) in ./$types?
The file has to be called +layout.server.ts (or for another load action, one of the other fixed names, see docs)
The Vite dev server has to be running, which watches the files and generates the types when a file is changed
(The tsconfig.json has to extend .svelte-kit\tsconfig.json, which defines rootDirs, so the generated types are resolved. This should already be the case, judging by the suggestion for LayoutServerData.)

Spring Annotations - Config with Array attributes

Currently have the following configuration and the application works as expected:
#CrossOrigin(origins = { "https://localhost:5000","http://localhost:5000"})
would like to change to something that can be configured in a properties file for different environments. I Can get to work with one Value but can't figure out a way for it to work with more than one. When a properties file is application-dev.properites has:
cors.client.urls=http://localhost:5000,https://localhost:5000
The appropriates values are not loaded with the following declaration:
#CrossOrigin(origins = {"${cors.client.urls}"})
When the properties file is just one value this declaration works as expected.
I know that I am missing something extremely basic.. Appreciate any help.
You can use SpringEL here as mentioned in Reading a List from properties file and load with spring annotation #Value
#CrossOrigin(origins = {#{'${cors.client.urls}'.split(',')}})

Maximum call stack size exceeded when using the new typescript enabled version of reactjs

I use the new typescript supported version of reactjs
along with the redux-orm and when u try to insert a value into the store i get this issue of "Maximum call stack size exceeded" the same works with the old template
Below is the code with new typescript supported reactjs which throws the error
https://reactjs.org/docs/static-type-checking.html#typescript and the old github version https://github.com/microsoft/TypeScript-React-Starter which works.
https://drive.google.com/open?id=15eolNjeYroyubgSmbGaaKfjxbe-IZ8KK
I am unable to understand what is different that causes the error with the new version. Thanks for any help.
Properties can't be defined directly on Model classes.
The root cause lies in the create-react-app's babel preset - transpilation output introduces additional property descriptors in Model prototype chain.
These properties interfere with descriptors installed by redux-orm during schema registration, resulting in Maximum call stack size exceeded error.
This can be avoided through declaration merging, specifically by providing a class and an interface with matching names. The interface contains Model properties, the class is almost 1:1 to JS Model definition.
Example:
interface Book {
id: number
title: string
}
class Book extends Model<typeof Book> {
static modelName = 'Book' as const
static fields = {
id: attr(),
title: attr()
}
}
I've created a repo with working example: https://github.com/tomasz-zablocki/redux-orm-ex-types-react-example
Mind you, these are custom types, but it's definitely where I'd like to take the #types/redux-orm package to, likely with the 0.14 release of redux-orm.

atom package: optionally load snippet file

When creating a language package for atom, it's possible to define a /snippets folder. Any files in here are automatically loaded when the package is active and the context (eg: ".source.js") is opened in the editor.
Now I'd like to contribute to the language-arma-atom package, where there's currently 3 snippet files: I want to add a checkbox option in the package settings to NOT load one of these files.
ie: I know how to add the option, but not how to exclude one of these snippet files.
The way I solved this was create a snippetsAvailable folder, put the files in there (and remove the snippets folder)*.
In your main package file, add to your config schema:
config:
optionalSnippets:
title: "My optional snippets"
description: "Adds optional snippets to autosuggestions"
type: "boolean"
default: true
And in your package's activation do something like this:
activate: ->
#subscriptions = new CompositeDisposable
# etc..
atom.config.observe 'my-package.optionalSnippets', (checked) ->
# For copyNewer, see note below *
copyNewer "my-snippets", "#{__dirname}/snippets", {
cwd: "#{__dirname}/snippetsAvailable"
}
* Note: I used the copyNewer package, because it allows me to remove the /snippets folder, ie: it will automatically create it again. More importantly, it won't overwrite the snippets file on each package activation; Except if you updated your package with new snippets.
Obviously you'll have to write copyNewer = require 'copy-newer' at the top of your main file.
Also, if you choose this method, don't forget to put /settings in .gitignore

Help with atk4-web, atk4-example ver. 4.03

I don't now where can I find help. None forums about atk4.
Can you help me, please?
atk4-web (4.0.3):
How run atk4-web localy, where is site dump (mysql database)?
What is mean this error:
No such tag (version) in template for Object AgileToolkitWeb(agile_project). Tags are: page_title, page_title#1, seo_keywords, seo_keywords#2, seo_descr, seo_descr#3, template, template#4, template#5, template#6, template#7, template#8, template#9, os, os#10, js_include, js_include#11, document_ready, document_ready#12, section, section#13, template#14, menu_about, menu_about#15, page, page#16, menu_doc, menu_doc#17, page#18, menu_develop, menu_develop#19, page#20, menu_services, menu_services#21, page#22, menu_download, menu_download#23, page#24, menu_blog, menu_blog#25, page#26, link_comparison, link_comparison#27, link_example, link_example#28, link_tour, link_tour#29, Content, Content#30, TabContent, TabContent#40
D:\Www\atk4web\atk4\lib\SMlite.php:341
atk4-example (4.0.3):
Why page has not javascrip included, when I allow ->check() in Frontend?
What is difference between empty.html and shared.html?
empty.html:
shared.html:
Why I got error when I did change in empty.html to:
Thanks.
Agile Toolkit uses template engine called 'SMlite'. Its very basic and allows you to load template, then set tags to a certain value.
$tpl->trySet('mytag',123);
Views in Agile Toolkit rely on this template engine and will try to generate their output and place inside parent's template. In your case object was instructed to use spot which did not exist in the template.
Read section about adding here: http://agiletoolkit.org/doc/learn, it should be helpful.
There are no need for JavaScript on auth login form. It also bypasses some of the UI/functionality due to security reasons. You can either create your own empty.html by placing it into template/jui/empty.html (without atk4) and enable javascript in there.
Also sequence of adding jUI and executing auth->check() might change this, but I'm not sure.

Resources