Giter VIP home page Giter VIP logo

webix-jet's Introduction

Webix Jet

npm version

Micro-framework for Webix UIMicro-framework for Webix UI

Useful links

Working with sources

//compile to es5
npm run dist

//run lint and test
npm run lint && npm run test

License terms

The MIT License (MIT)
Copyright (c) 2016 XBSoftware

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

webix-jet's People

Contributors

dependabot[bot] avatar helgalistopad avatar kullias avatar lveliarl avatar mkozhukh avatar plandem avatar zek avatar zwillinge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webix-jet's Issues

Fail when running on Mac

Getting message: env: node\r: No such file or directory
when trying: wjet init

(MacBook, El Capitan)

form.isDirty() failed using localId

Hi

When using the global id on a form to get dirty status, everything works fine.

When using the local id on a form to get dirty status, it failed

TypeError: Cannot read properties of undefined (reading 'queryView')
    at JetBase.$$ (webix-jet.js?12:83:31)
    at Object.template (<anonymous>:77:28)
    at result._toHTML (webix.js?12:2727:29)
    at result.render (webix.js?12:2739:44)
    at result.render (webix.js?12:26770:29)
    at result.$setSize (webix.js?12:26656:14)
    at result._set_child_size (webix.js?12:21995:24)
    at result._set_child_size (webix.js?12:22406:45)
    at result.$setSize (webix.js?12:22397:12)
    at result._set_child_size (webix.js?12:22008:24)

https://snippet.webix.com/fbir7y9b

Cheers

Typescript

I'm using webix jet with typescript; however, after update I got errors like 'Property 'config' does not exist on type 'App'.'. I was able to upgrade up to version 2.2.0-beta3 (https://www.npmjs.com/package/webix-jet/v/2.2.0-beta3). I see that the latest versions are using .mjs files... might this causing the issue for me?

My app is based on the webix-jet starter typescript template downloaded from GitHub. I cannot find an updated version. Please can you provide me with a hint on how to continue?

Thanks!

JetApp.refresh() and multilevel sidebar

I have a multi-level sidebar loaded with

webix
  .ajax()
  .get("/my/menu/endpoint")
  .then(res => {
    const menu = res.json().map(convertMenuData);
    sidebarConfig.parse(menu, "json");
  });

where

sidebarConfig is a webix.DataCollection().

When this.app.refresh() is executed in another part of the app (to change language, for example) the whole app refresh and the sidebar is loaded with only the first level items.

If i try to inspect sidebarConfig (the DataCollection) I can also only see the first level items of the menu.

Any ideas?

richselect component getValue() not used

Hello, I'm using webix-jet to build a web page. This page need provide a form to get different filtering conditions. I use richselect component and some input to complete this ,but there are some difficult.

  1. In this form, "filter_compare_input" has two style and it controlled by richselect which name is text2. But there has some error,the "filter_compare_input" can't display in the web page, I also try using function,but it has same question. I had saw the webix-jet-demo, but can't resolve this. Meanwhile , I try to use $$("text2").getValue() ,but failed , this code is can be used in Webix Code Sample,and failed in here. The code as follow:

  2. Because of there are multi filtering conditions, would I can get different value by getValue()? Or,it needs some other functions?

var filter_compare_input;
var filter_compare_input1 = {cols:[
	{ view:"text", name:"startvalue",label:"From:",inputName:"startvalue",labelPosition:"left"},
	{ view:"text", name:"endvalue",label:"To:",inputName:"endvalue",labelPosition:"left"},
]};
return {
	rows:[
		{
			view:"form",
			localId:"filter_form",
			rows:[
			        filter_shotNum,
				filter_keyword,
				{
					cols:[{
						width:250,cols:[{
							view:"richselect",id:"richselect3",value:1,inputWidth:110,
										options:[
											{ id:1, value:"IP(KA)" },
											{ id:2, value:"HCN(KV)" },
											{ id:3, value:"Shot_Len(S)"}
										],},		
						{view:"richselect",name:"text2",value:1,inputWidth:110,
										options:[
											{ id:1, value:"Large than >" },
											{ id:2, value:"Less than <" },
											{ id:3, value:"Range"}
										],on:{
												onChange(id){
													console.log(id)
													if(id == 3){
														filter_compare_input = filter_compare_input1
													}
													else{
														filter_compare_input = { view:"text", name:"compare_value",placeholder:"Input value",inputName:"compare_value"}
													}
												}
											}
									},]
								},
								// this is a input component and it has two style
								filter_compare_input,
							]

Thank you for answer.

prevent end user to loose some changes

Hi again

I’m looking for a clean way to prevent user to loose some changes after a form became dirty.

Below an example:
https://snippet.webix.com/d6707336

  1. go to the form page
  2. type something in the textarea or the text input, the label "dirty return … " will be updated
  3. when dirty return TRUE, AND if the user click “start” in the sidebar, i’d like to webix.confirm something, and depending of the result, allow page change or not.

I didn't find something in the documentation related to that, but perhaps i missed something.

Any hints ? ty

errors.ts missing

Guard.ts imports error.ts

import {NavigationBlocked} from "../errors";

But errors.ts is missing.

errors.ts with following content works for the moment

export class NavigationBlocked {};

view.ui returns before subview fully initialized

If view.ui API is used against a complex view with subviews then API return view object while its sub-element are not initialized

It will be nice to return a promise of View instead of view from this method.

Incorrect path to xcrun on OSX

Hello,

It looks like that the path to xcrun is not correctly detected: althought available as /usr/bin/xcrun, it looks for it in /Library/Developer/CommandLineTools/usr/bin/xcrun.

ilema@minix /files/dev/wspace_webix/wjet-test-1 > wjet init
? Give your app a name wjet-test-1
? Do you want to create a multi-language app? Yes
? Do you want to use multiple skins? No
? Css pre-processor? Less
/usr/local/lib/node_modules/wjet/templates/noserver
/usr/local/lib/node_modules/wjet/templates/extras/settings
/usr/local/lib/node_modules/wjet/templates/extras/less
/usr/local/lib/node_modules/wjet/templates/extras/settings/views
/usr/local/lib/node_modules/wjet/templates/extras/less/assets
/usr/local/lib/node_modules/wjet/templates/noserver/.bowerrc
/usr/local/lib/node_modules/wjet/templates/extras/settings/views/personal.js
/usr/local/lib/node_modules/wjet/templates/extras/less/assets/app.less
/usr/local/lib/node_modules/wjet/templates/extras/less/assets/common.less
/usr/local/lib/node_modules/wjet/templates/noserver/.npmignore
/usr/local/lib/node_modules/wjet/templates/extras/settings/views/settings.js
/usr/local/lib/node_modules/wjet/templates/extras/less/assets/theme.siberia.less
/usr/local/lib/node_modules/wjet/templates/noserver/README.md
/usr/local/lib/node_modules/wjet/templates/noserver/app.js
/usr/local/lib/node_modules/wjet/templates/noserver/bower.json
/usr/local/lib/node_modules/wjet/templates/noserver/gulpfile.js
/usr/local/lib/node_modules/wjet/templates/noserver/index.html
/usr/local/lib/node_modules/wjet/templates/noserver/jshint.conf.js
/usr/local/lib/node_modules/wjet/templates/noserver/models
/usr/local/lib/node_modules/wjet/templates/noserver/package.json
/usr/local/lib/node_modules/wjet/templates/noserver/views
/usr/local/lib/node_modules/wjet/templates/noserver/models/records.js
/usr/local/lib/node_modules/wjet/templates/noserver/views/data.js
/usr/local/lib/node_modules/wjet/templates/noserver/views/start.js
/usr/local/lib/node_modules/wjet/templates/noserver/views/top.js
Insaling dependencies...
done
/usr/local/lib/node_modules/wjet/node_modules/bower/node_modules/q/q.js:155
                throw e;
                      ^
Error: Failed to execute "git ls-remote --tags --heads git://github.com/webix-hub/tracker.git", exit code of #1
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

    at createError (/usr/local/lib/node_modules/wjet/node_modules/bower/lib/util/createError.js:4:15)
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/wjet/node_modules/bower/lib/util/cmd.js:102:21)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Socket.<anonymous> (child_process.js:1183:11)
    at Socket.emit (events.js:107:17)
    at Pipe.close (net.js:485:12)
ilema@minix /files/dev/wspace_webix/wjet-test-1 > 

ilema@minix /files/dev/wspace_webix/wjet-test-1 > which xcrun
/usr/bin/xcrun
ilema@minix /files/dev/wspace_webix/wjet-test-1 >

Thanks

User plugin and initial view

I've just added the user plugin and it works but not for the initial view. My initial view is '/top/start' but the app is not redirecting to the login view. If I navigate to another view I will be redirected. How can I resolve this issue?

setParam error

Lets assume we are in path /app/page and it gives error when we call setParam("id", 1, true)

It's okay to call setParam when we are in /app/page/xxx but not possible when we are in /app/page

I tried to write a solution in #15

Guard and url params

I've a JET view which has two plugins: UrlParam and UnloadGuard. The app is using the HashRouter. The issue is that when I click the browsers' back button the parameter is directly removed before it even hits the UnloadGuard.

The UnloadGuard is implemented as follows (in the init method):

this.use(plugins.UnloadGuard, args => {
      const form = this.$$("frm");

      if (form.isVisible() && form.isDirty()) {
        return webix
          .confirm({
            title: "Form is incomplete",
            text: "Do you still want to leave?"
          })
      }

      return true;
});
this.use(plugins.UrlParam, ["id", "canvasEntityId"]);

Example: The URL looks like '.../task/1'. After I click the browsers' back button the url looks like '.../task' and not awaits the UnloadGuard (as I expect).

How can I work around this? Any help is highly appreciated because I need this ASAP (as always...).

Thanks,
Martin

Refreshing JetView

I am trying to create a configurable datatable view

What I need is changing configuration dynamically.

self._render() doesn't work when I am switching between pages. After _render, this.container.$destructed is true. So I can't call _render again.

Is there any way to refresh or render the view?

export class RecordsView extends JetView {
	protected property_menu: PropertyMenu;
	protected _config = {
		property_menu: true,
		unit: true,
		price: true,
	};
	constructor(app, name, config = {}) {
		super(app, name);
		this.setConfig(config);
	}
	setConfig(config = {}, render = false){
		this._config = Object.assign(this._config, config);
		if(render){
			//self._render();
		}
	}
	config(): any {
		let self = this;
		return {
			autoheight: true,
			minHeight: 200,
			view: "datatable", select: true, scrollY: true, navigation: true,
			columns: [
				{
					id: "unit_price",
					header: "Price",
					width: 140,
					editor: "text",
					disabled: !self._config.price,
					hidden: !self._config.price,
				}
			]
		}
	}
}

wjet init fails (at least on OSX)

Hi Maksim,

Maybe it's too early in the process, but I just tried to see the result:

[ilema@visva webix]$ mkdir wjetApp1
[ilema@visva webix]$ cd wjetApp1/
[ilema@visva wjetApp1]$
[ilema@visva wjetApp1]$ wjet init
env: node\r: No such file or directory
[ilema@visva wjetApp1]$

NPM/Node versions:

[ilema@visva wjetApp1]$ node -v
v0.12.7
[ilema@visva wjetApp1]$ 
[ilema@visva wjetApp1]$ npm -v
2.11.3
[ilema@visva wjetApp1]$

setParam exists, what about removeParam ?

Hello,

Perhaps i missed something, but it's sound like you can not "removeParam". The only way is setParam("myParam", "");

Should be great to have a removeParam or deleteParam method.

Init window/popup view class with Webix-Jet doesn't work because of webpack transpiling

I'm facing the issue that the window/popup and context menu view that defined to extends JetView will not be able to init by this.ui() inside the parent view. Please see the example code below:

class WindowsView extends JetView {
    config(){
        return {
            view:"popup",
            top:200, left:300,
            body:{ template:"Text 2 (fixed position)" }
        };
    }
    showWindow(){
        this.getRoot().show();
    }
}

class TopView extends JetView {
  config(){
    return {
      rows:[{
      	template:"Webix Jet Demo", type:"header"
      },{
        view:"button",
        value: "window",
        click: () => {
          this.context.showWindow()
        }
      }]
    }
  }  
  init(){
    this.context = this.ui(WindowsView);
    console.log(this.context)
  }
  destroy(){
    $$("context").destructor();
  }
}


var app = new JetApp({
  start:"/top",
  debug:true,
  views:{
    top: TopView
  }
});

app.render();

As my investigation, webpack build will transpile the class to function form in the end, and then webix will not able to determine the input layout/view, it will return a spacer view (something like that) as default.

So is there any solutions for this, I want to keep the layout and logic of the window/popup extends JetView.

Please advise.
Many thanks

Question: full lazy loading.

Hi.
If I need to place all views and models into separate bundles. What project structure should I have? Do I need to place all files into modules folder or it can be resolved by changing some webpack config?

And is it preferred to use TypeScript for new project? Do you plan to rewrite webix lib on TS?

Static files

Hi!

How can I include a static file? (like, a png or a json)

Function ui and getRoot

Hi! I am using TypeScript and WebixJet.
You cannot pass new MyWindowsView (this.app, “”, myParams) to the this.ui (), I use // @ ts-ignore
And TS swears at this.getRoot (). QueryView () - queryView does not exist on type IBaseView

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.