Kkula
Dear experts,
I'm using project example below for custom web control table
Integrating user-defined controls into WinCC Unified (Custom Web Controls) - ID: 109779176 - Industry Support Siemens
My question is how we get a selected row data (with mouse click)?
I'm new with javascript code
Thanks in advance
Regards,
Atabik
Dear Atabik,
Based on the Siemens Industry Support ID 109779176, to retrieve data from a selected row in your custom web control table (using JavaScript), you'll need to handle the 'rowClick' event of the table.
Here's a general approach:
Example Snippet (Conceptual):
// Assuming 'myTable' is the ID of your table control
myTable.onRowClick = function(row, column) {
// 'row' is the row index
// 'column' is the column index (if needed)
var rowData = myTable.getRowData(row);
//This function depends on your specific table implementation.
//Refer to the table control's documentation for the correct method.
//Access values by column index. For example:
var value1 = rowData[0];
var value2 = rowData[1];
//Do something with the selected row data
console.log("Selected Row Data:", value1, value2);
};
Important: The specific methods for getting row data (e.g., getRowData) will depend on the specific JavaScript table library or control you are using within WinCC Unified. Refer to the documentation for that particular library for details.
As you're new to JavaScript, start with simple examples and gradually build up your code. Don't hesitate to consult the Siemens documentation and online resources for further assistance.
Best regards,
Siemens Self Support
Our flexible community website is a platform that allows users to connect, share information, and collaborate on various topics of interest. The website offers a range of features such as discussion forums, messaging, user profiles, event calendars, and more. Users can customize their experience by creating and joining different groups or communities based on their interests or location. The website is designed to be user-friendly and adaptable to the needs and preferences of our diverse user base. Whether you are looking to network professionally, share hobbies and interests, or simply connect with like-minded individuals, our flexible community website has something for everyone. Join us today and become a part of our thriving online community!
India
Copyright ©2025
Share this page with your family and friends.