ngx-datatable - how to define 'cell class' for columns at runtime - ngx-datatable

<ngx-datatable
id="ngxdatatable"
class='material striped'
[rows]="rows"
[columns] ="columns"
>
</ngx-datatable>
I tried to bind columns, which columns are getting at run time using columns properties from class object.
I want to style a specific column using cell class using css. How this can be achieved. Please help

I would recommend looking at some of the source code for styling header and column cells as well as how to create column templates, such as:
https://github.com/swimlane/ngx-datatable/blob/master/demo/basic/css.component.ts and https://github.com/swimlane/ngx-datatable/blob/master/demo/basic/row-detail.component.ts
You can style the column headers by adding the [headerClass]="insertYourCssClassName" inside the column template tag like this:
<ngx-datatable-column
name="ID"
prop="id"
[headerClass]="insertYourCssClassNameHere"
>
Same thing goes for styling the body cells, only with [cellClass] instead of [headerClass].

Related

In Vue, how can I reference multiple similar elements from server rendered template?

I have a table of number inputs for different products. Each row looks like this:
<tr>
<td><input type="number" name=quantity1 value="0"></td>
</tr>
At the bottom, I'd like to show a sum of quantities based on what the user inputs on each row. All html code is server rendered and I only use Vue for the interactive part, so I'm not using v-for to generate the list on the client.
My question is: Is there a way to annotate the server template (or another technique) so that I can easily reference the input value of each row with Vue (aside from something like vanilla querySelector)? I imagine there must be something more in the lines of v-model that would perhaps collect all values in a data array or similar. Thanks!

Contains CSS Selector to fill a form with nightwatch / selenium

My Problem:
The Page I try to test with NightwatchJS Contains Some Input Fields that have the Same beginning, but a random number is added. I want to Fill the Textfield on the page. Only one with this name is present on the same time.
<input id="groupNamec7aed06a-67a1-4780-9cc3-5b985666adb9" class="d-styled-input" data-value-update="keyup" data-bind="value: name" title="">
Is the definition of the Field. groupName is every Time the same, but the number changes.
Is there a possibility to use CSS Selector in nightwatch instead of XPATH?
You can try this way :
input[id^="groupName"]
From MDN > Attribute selectors :
[attr^=value] : Represents an element with an attribute name of attr and whose first value is prefixed by "value".
Unfortunately CSS Selector does not provide such a way. You could use a different CSS Selector to match inputs with an id and get those as a list. Afterwards using getAttribute('id') you could do it manually, but this seems like unnecessary effort to me and I'd recommend just using Xpath.
Ofcourse you could try and get a different unique CSS Selector. If it's in a form you could locate the form and use :nth-child but if I remember correctly this has limited/no support in IE.
Edit Apparently IE9 and later does support :nth-child

OpenUI5/SAPUI5 how to make table rows with extra text

I have a UI5 table, but would like to have an input element that span multiply rows under the other text. Something like the table below.
<table>
<tr><td>v1</td><td> v2</td><td> v3</td></tr><br>
<tr><td >input text </td></tr>
</table>
Unfortunately, you'll have to find another approach. The sap.m.Table type does not currently support this, as there are no span type of properties on the sap.m.Column type.
Ok. Learned that it is not possible at the moment.
So I'm just going to use a textarea at the end of the line. I think it may look okay.
Did you mean row span like here or column span like here
For rowspan there is existing sap.m.Column attribute mergeDuplicates you may want to check.

how to combine html:text and bean:write

I am using <bean:write/> tag in my struts program to catch my data into text field but I want to update/edit those data which is coming by this tag so I want to use <html:text/> tag with <bean:write/>, is it possible?
is there any other option to update <bean:write/> tag's data.
I am using this tag like -
<bean:write name="Customer" property="lastname"/>
It's not entirely clear to me what you want to update, and under what circumstances.
If you're saying to want to have the customer's last name be an editable text field, then initialize the ActionForm with the appropriate values before displaying it to the user; you don't need the <bean:write> tag at all if you're just trying to initialize/show a form field.

how to work with rows in struts using display tag....?

In jsp I'm using Display tag to print a table.
I want to display multiple properties in a single row.
Suppose I want to show some information about the particular content of that row.
ex
row1
title:-How to display an image in html ?
started by:-mohit on:-21.10.11
row2
title:-How to display an image in html ?
started by:-mohit on:-21.10.11
row3
title:-How to display an image in html ?
started by:-mohit on:-21.10.11
row4
title:-How to display an image in html ?
started by:-mohit on:-21.10.11
Please help me guy's I have to submit my project after 4 to 5 days.
It is recommended to set the values (to be displayed in displayTag) in the Action class.
It would be even better if you can create a bean class (holding title, startedBy etc. as a properties).
Then retrieve the data from the database and for each row creates an object of your bean class (by setting the values in the properties) and store this object in an ArrayList. When you finished retrieving the data, set this ArrayList as an attribute in either request or session scope.
Suppose you have set the attribute with the name "tableData" in session scope.
Then, in your Jsp you can provide
<display:table id="data" name="sessionScope.tableData">
<display:column> <bean:write name="data" property="title" /> </display:column>
</display:table>
I hope this will help you to understand the scenario.