How to add a button or link to the table - Forum

Forum Navigation
You need to log in to create posts and topics.

How to add a button or link to the table

Hello and good time dear friends...! How can a button or link be placed inside some of the houses of the table? Like the sample photo...! Thanks

Uploaded files:
  • You need to login to have access to uploads.

@javadrajabihakami

I am assuming that you are taking about a Table rendered using the neoTable plugin commands.

You can alter the contents of a cell via a subroutine ... take a look at the neoTable Tutorial ...

Sample Apps >>> Tutorials >>> neoTable Tutorial Part 1 >>> page named Subroutines >>> button labelled Load Data

... the neoTableSetColumn command allows you to specify a subroutine ... in this Tutorial, the case of the Surname text and the color of the Age in each row are modified ... you can similarly respond with the html link tag i.e. < a > ... < /a >

javadrajabihakami has reacted to this post.
javadrajabihakami

Dear friend, thank you for your reply! But thank you for giving an example for learning! Thanks

I added the desired class to the desired field of the table! But I can't add the required commands in the on event subroutine! That is, I added a subroutine and added a code to click on each class! But I do not understand! Thank you for your help! Thanks
I want to be able to get the desired row id by clicking on any of the items in the operateitem field and perform the desired operation! Thanks

Uploaded files:
  • You need to login to have access to uploads.

@javadrajabihakami

The example you provided depends on some database on some server that I do not know because I do not have the associated php script related files.

If you want users to assist you with one particular issue, then you should provide a simple VisualNEOWeb project with ONLY the aspects related to that issue; in this case, it would be a neoTable loaded from an in-memory json data set (like in the Tutorial) ... and your attempt to invoke the event related subroutine(s).

Also, please include ONLY the subroutines that are being invoked from objects in your pages (in your project, I could not figure out where some of the subroutines were being invoked.

luishp and javadrajabihakami have reacted to this post.
luishpjavadrajabihakami

Dear friend, thank you for your reply!
I use this code in the on event subroutine

And everything works fine!

But I have a problem in understanding the program in choosing a class

BeginJS
$('.edit').on('click',function(){
alert('You click edit action')
var editet = ok       (I fail to use this variable outside of this code after selecting the desired class!

}),
$('.dele').on('click',function(){
alert('You click delete action')
var delete = ok        (I fail to use this variable outside of this code after selecting the desired class!
})
EndJS
.///////////////////////////////////////////////// /////////////
If [editet] == ​​ok
MessageBox "11111111" "11111111" "111" ""
else
endif
.///////////////////////////////
I fail when I choose a class! Give a default value to an arbitrary variable and use it outside of JavaScript code...

Sample project

Uploaded files:
  • You need to login to have access to uploads.

@javadrajabihakami

var editet = ok (I fail to use this variable outside of this code after selecting the desired class!

1) the value should be wrapped in quotation marks e.g. var editet = "ok"
2) each javascript command should be terminated by a semicolon

I fail when I choose a class! Give a default value to an arbitrary variable and use it outside of JavaScript code...

I am not sure i am clear about what you are saying, but check out this Help page ...

https://webhelp.visualneo.com/AccessingVariablesfromJavaScript.html

... to understand how javascript variables can be used to update variables in the VisualNEOWeb data space

 

Later today, when I have some free time, I will examine your latest zip file.

@javadrajabihakami

Take a look at the uploaded edited App ... it is not in its final stage but it will allow you to learn the steps involved.

a) the columns for Edit and Delete actions are currently hard coded as text (Edit and Delete) in every item of the JSON object ... these can be replaced later by (say) links to icon/image files ... perhaps in the format subroutine

b) as you will see below the container, you have all the information you need to determine which row, column, itemID was clicked ... so you can add your commands to edit/delete these rows of information (perhaps passing these values as parameters to a generic edit (and a generic delete) subroutine.

Note that the information about the current row is in a JSON format; please advise if you do not know how to extract the "value" associated with any of the "keys".

Uploaded files:
  • You need to login to have access to uploads.
luishp and javadrajabihakami have reacted to this post.
luishpjavadrajabihakami

Hello and good time! Is there a way to select any of the buttons in the table? Can we choose the row and have the ID of the row?

Uploaded files:
  • You need to login to have access to uploads.

@javadrajabihakami

Is there a way to select any of the buttons in the table? Can we choose the row and have the ID of the row?

As per my previous version of the App, the value of every item (column text) in the clicked row is already passed to the subroutine ... including the row and ID of the item in the row.

So, if you allow a SEPARATE column/field for the EDIT and DELETE actions, with each action having its own SEPARATE subroutine, all the information you need is available to the subroutine.

You can still make the text look like buttons; just use a span tag instead of a button tag. Better still, you can show an image or icon instead of plain text.

You don't need the javascript (jQuery) event handlers; the plugin has everything you need.

luishp and javadrajabihakami have reacted to this post.
luishpjavadrajabihakami

Dear friend, thanks for your guidance and inspiration...!

Open chat
1
Do you need more info?
Hi, do you have any doubt?