CRM365 How to modify Grid Column Height And Width With Css - dynamics-crm-365

Here Im New to CRM
Please Help me how can i modified Grid Coulmn Height & Width. I Got Some Sudo code as
function Modifiescolum(executionContext){
var formContext=executionContext.GetGridContext();
}
on executionContext Im Getting Json Data Please Help me How can i overcome This issue

Related

Do I have to append textarea to the document to get its height?

Following code:
let textArea = document.createElement('textarea');
textArea.value = responseTextFromXMLHttpRequest;
$('body').append(textArea);
console.log(textArea.scrollHeight);
Gives me this result in the CONSOLE: 34
But if I don't append the textarea to the body then I get in CONSOLE: 0
Can I make the textarea to update the height without appending it first to the document? Somehow force it?
I am asking because I create 300 textareas which I fill with text and need to know their height to style them. And I am not sure if appending them to the document just to get their height is the best way I can do it. I am afraid that appending them and afterwards removing just to get the height would take up more resources than some other method if it exist.

Content width is increasing for every new change

I have a project where one of it's windows is a ScrollPane that has a GridPane as a content. when I click on a new node, or I start typing on the text fields. the width of a GridPane's column increases unintentionally. can anyone explain why would that be happening.
I tried to get rid of ScrollPane on the window but it's still going on. My window's width is bind to the window's width also.
Thank you so much for your support on this problem. Turns out the issue was something completely unrelated to anything I wrote down. The problem was on a TableView I set to increase its columns' width based on the content.
ingredientTable = new TableView<Ingredient>();
ingAmount = new TableColumn<Ingredient, Integer>("amount");
ingUnit = new TableColumn<Ingredient, String>("unit");
ingName = new TableColumn<Ingredient, String>("item");
ingredientTable.getColumns().addAll(ingAmount, ingUnit, ingName);
ingAmount.prefWidthProperty().bind(ingredientTable.widthProperty().multiply(0.1));
ingUnit.prefWidthProperty().bind(ingredientTable.widthProperty().multiply(0.2));
ingName.prefWidthProperty().bind(ingredientTable.widthProperty().multiply(0.70));
For some reason, whenever I changed content anywhere (clicked on a new node or type on TextField) the tableview would increase it's width. I just reduced the multiply parameter of one of the TableColumn to 0.01 and that seemed to solve the problem.
I'm sorry for my lack of information and expect more details in future posts

Is there way to set detailRowHeight prop to 100% in ag-grid?

Recently started working on a master detail structure angular ag-grid. The structure has two levels of master-detail nesting. I need to fix the heights of inner - 2 grids such that they occupy all available real estate on the screen. Currently, ag-grid defaults it to 300 px and a lot of whitespace or unused space appears on a 1920x1200 screen resolution monitor. I also need to have fixed headers for all grids.
Any ideas or pointers would be appreciated...
Update: Referring to a forked version of plunker example from ag-grid here - https://next.plnkr.co/edit/yUzo4EqONEmgCmIw This is simple and basic set up for master-detail grid.
Note that: I haven't set any detail row height and have setup just one record to show up in the grid to test for the issue.
If you run the plunker code and view the result in separate window, notice that the inner / child grid doesn't occupy all the space available below it. In other words, it doesn't take as much as space/height available from parent container (master's detail row). The default 300px master detailRowHeight is making height fixed for inner grid. Also, from documentation, detailRowHeight prop doesn't seem to take something similar as 100% or 100vh and only takes fixed pixels number. Added a picture of the example below and the height / unused space I referred
We have different resolutions that users use to view data in grid and the heights of inner grids need to auto-adjust taking max. available space to show most information in the grids.
You could try something like this, I pulled it from the documentation:
In your component.ts file add this method. If it's a detail row it will apply different calculations than the other rows.
public rowHeight(params) {
if (params.node && params.node.detail) {
var offset = 80;
var allDetailRowHeight = params.data.callRecords.length * 28;
return allDetailRowHeight + offset;
} else {
// otherwise return fixed master row height
return 25;
}
};
In your template add the following: [getRowHeight]="rowHeight"
<ag-grid-angular
#agGrid
style="width: 100%; height: 100%;"
id="myGrid"
class="ag-theme-balham"
[columnDefs]="columnDefs"
[masterDetail]="true"
[detailCellRendererParams]="detailCellRendererParams"
[getRowHeight]="rowHeight"
[rowData]="rowData"
(gridReady)="onGridReady($event)"
></ag-grid-angular>
Hopefully this will get you moving forward. Good Luck!
https://www.ag-grid.com/javascript-grid-master-detail/#detail-row-height
So I don't have a great, full solution for you but as a starting point I would use CSS to override the styles ag-grid is setting - I don't think detailRowHeight is going to help.
Here's my plunk getting close to what you want with some simple CSS I put in index.html. You can use !important to override ag-grid styles, or you could use javascript to set the CSS after ag-grid does. I prefer !important in this case and don't have to worry about timing.
https://next.plnkr.co/edit/mmXBBJE5Wa1JrX7v
The problem I wasn't going to get into is getting it to dynamically fill up available space, depending on the row selected, scroll position, etc. I can't think of any simple way to achieve that - I do this type of thing in grid often and end up writing javascript to calculate the available space, and then set the CSS in javascript.
In ag-grid you have the possibility to set auto height for details.
Set grid property detailRowAutoHeight=true to have the detail grid to dynamically change it's height to fit it's rows.
const gridOptions = {
// dynamically set row height for all detail grids
detailRowAutoHeight: true,
// other grid options ...
}
However if you are providing your own detail component...
detailCellRenderer: 'MyOwnDetailsComponent',
then, it might not work and you will still need to provide an grid options height detail content through...
detailRowHeight: 560,
Please see the ag-grid documentation here

Using itext and jfreechart need to create image for legendtitle alone

Can you please help me to get Image for legendtitle alone ?
I am using pieplot3d & doing customization and later I create legendtitle(plot
when I use draw method
legend.draw(graphics2d,rectangle2d
graphics2.dispose
Image.getInstance(template
I am using jfreechart with Itext & doing as mention below
add image to document or PdfCell its empty.
My requirment is to show plot/chart in seperate cell/table & legend in seperate cell table so that when there is change in size of legenditems size of chart wont change.
Please help.

Is it possible to "shrink" a PdfPtable?

I am currently working with Itextsharp and I have some trouble with PDfPtables.
Sometimes they get too big for a page and, when added to a document, are broken up on multiple pages.
Sadly ths rational behviour is not acceptable for some of my superiors - they keep insisting that the table shall be "shrunk" to a page. Is there a way to achieve this? There are some tantalizing hints that i could be possible - but hints are all that i have.
What is the alternative? Perhaps I could delete the fat table from the document and build the table again with smaller Fonts and Cells, but that would be very cumberosme - I would prefer to "zoom out", in lack of a better word.
My current code:
Dim test As PdfContentByte = mywriter.DirectContent
Dim templ = test.CreateTemplate(mywriter.PageSize.Width, mywriter.PageSize.Height)
Table.WriteSelectedRows(0, Table.Rows.Count - 1, 0.0F, mywriter.PageSize.Height, templ)
Dim myimage = Image.GetInstance(templ)
' myimage.ScaleAbsolute(mywriter.PageSize.Width, mywriter.PageSize.Height)
would scaleabsolute be necessary?
myimage.SetAbsolutePosition(0, 0)
test.AddImage(myimage)
This code puts something one the page, but it has the height of the page and the width is about a quarter of the page - wi will try to find the bug...
Create the table and define a 'total width'. As soon as iText knows the width of the table, you can calculate the height of all the rows. Once you know the height, you can check:
Does the table fit the page? Just add it as is. Maybe using WriteSelectedRows if you don't want to take any page margins into account.
Isn't there enough space on the page? Add the table to a PdfTemplate (there's more than one way to do this), wrap the PdfTemplate inside an Image. Scale the image, and add it to the document.