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

Various bugs and fix requests with w2ui.form #2081

Open
mansurdegirmenci opened this issue Aug 16, 2021 · 11 comments
Open

Various bugs and fix requests with w2ui.form #2081

mansurdegirmenci opened this issue Aug 16, 2021 · 11 comments
Labels
2.0 2.0 branch / release Feature Request

Comments

@mansurdegirmenci
Copy link
Contributor

1- The disable feature should be added to the action button. because I don't want the save button to be active. I want it to be active when there is a change in w2ui.form. In this, it is necessary to add disabled to the button.

2- "render" method should be added for each field in w2ui.form.
example;

{
field: 'CreatedDateTime',
type: 'datetime',
html: {
label: 'Oluşturulma Tarihi'
},
render: function (date) {
return w2utils.date(date)
}
}

3- I have a function create Form(recid, title) {} method. If I'm going to make an edit, I assign the value of selection to the value of recid. If I am going to add a new record, I give its value zero. but there is a problem. For example, there is a field called CreateDateTime. It should be displayed when edited. "CreateDateTime" should not be a field when adding a new record. ok this issue seems to be "push"able using the w2ui.form.fields array. but then "render function" probably won't work.

4- When the text field is disabled, the cursor sign appears when the mouse is hovered, it looks like it can be edited. cursor icon should be changed to make it understandable.

Appearing
image

Must be
image

@mrg2001
Copy link
Collaborator

mrg2001 commented Aug 23, 2021

Thank you for you feedback. Some points are great. Here is some feedback (I will keep the issue open to make sure it is taken care of)

  1. Arguable. Clicking on save button should show error messages. It is helpful for user to see what is not filled out. There is only one valid case (in my opinion), when you open existing data and did not save it. But it is no such a problem if you resave it.
  2. Good idea
  3. CreateDateTime should not be part of form at all.
  4. Good idea

@mrg2001 mrg2001 added the 2.0 2.0 branch / release label Aug 23, 2021
@mansurdegirmenci
Copy link
Contributor Author

  1. There is a problem with "render function" on "grid". I didn't want to open another issue. The "render function" method does not work when adding or updating a data in the "grid". If the subject of "render function" is to be added to the "form", such a subject should also be considered.

@mansurdegirmenci
Copy link
Contributor Author

  1. What I want to say is not a validation. I just want to point this out. If there is no change in the form while adding or updating new data, why should the button be active?

@mansurdegirmenci
Copy link
Contributor Author

  1. w2fieldlist can be remote sourced. I have a request to add a "boolean" "property" as LoadAll. A huge list doesn't make any sense either. I want the user to see the whole list. ok as far as i know there is a "load" method but i need to process from your server. loadall should be added for practicality.

@james-yong
Copy link
Contributor

  1. There is a problem with "render function" on "grid". I didn't want to open another issue. The "render function" method does not work when adding or updating a data in the "grid". If the subject of "render function" is to be added to the "form", such a subject should also be considered.

Unmerged changes for grid can be found at record.w2ui.changes

@mansurdegirmenci
Copy link
Contributor Author

Unmerged changes for grid can be found at record.w2ui.changes

i have render function. When I make changes on the grid using the "add" or "set" method, the "render function" does not work. I didn't understand your post :)

I don't want to access anything via changes :)

Example;

 
	{
						field: 'Ping',
						text: 'Ping',
						size: '45px',
						sortable: true,
						resizable: true,
						render: function (record, index, column_index) {

							let localdate = new Date(record.CheckDateTime).toLocaleTimeString()

							if (record.Ping == true) {
								return '<i class="fa fa-check-circle fa-lg" style="color:green" aria-hidden="true" title="' + localdate + '"></i>'
							}
							else if (record.Ping == false) {
								return '<i class="fa fa-times fa-lg" style="color:red" aria-hidden="true" title="' + localdate + '"></i>'
							}
							else {
								return '<i class="fa fa-hourglass  fa-lg" style="color:orange" aria-hidden="true" title="' + localdate + '"></i>'
							}

						}
					}

@james-yong
Copy link
Contributor

james-yong commented Aug 28, 2021

if using underscore js, you can try something like
var CheckDateTime = _.get(record, 'w2ui.changes.CheckDateTime', record.CheckDateTime);

and also to make sure the grid's refreshRow method is run after the change.

@mpf82
Copy link
Collaborator

mpf82 commented Aug 30, 2021

2- "render" method should be added for each field in w2ui.form.

Sound like you want to use a custom w2field type. The advantage: if you have 100 fields that should all behave the same, you implement the custom type once, instead of defining the same render function in 100 different places.

See: http://w2ui.com/web/docs/1.5/form/fields-custom

@mansurdegirmenci
Copy link
Contributor Author

mansurdegirmenci commented Sep 10, 2021

The "input" required property, which is "disabled", must not be active. Also, it should not be sent in the request process.

image

@mansurdegirmenci
Copy link
Contributor Author

2- "render" method should be added for each field in w2ui.form.

Sound like you want to use a custom w2field type. The advantage: if you have 100 fields that should all behave the same, you implement the custom type once, instead of defining the same render function in 100 different places.

See: http://w2ui.com/web/docs/1.5/form/fields-custom

How can I use it in the form? can you give an example?

@mpf82
Copy link
Collaborator

mpf82 commented Sep 13, 2021

How can I use it in the form? can you give an example?

Demo for w2ui 2.0:

http://jsfiddle.net/5z1boft7/

For w2ui 1.5 replace

addType( 'mytype', function(options) {

with

$().w2field('addType', 'myType', function (options) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0 2.0 branch / release Feature Request
Projects
None yet
Development

No branches or pull requests

4 participants