I am having trouble with the GridJS control for .NET. I can’t find information on how to set the width and height of the x_spreadsheet control so that it fits, for example, the container in which it is located. I want to place it in a div that has, for example, 50% of the width and 50% of the height of the page. How can I make it properly fit and resize with the browser window? Currently, the x_spreadsheet control adjusts to 100% of the width and height of the window. This changes dynamically upon resizing the browser window. The other option I found is to set a fixed width and height, such as 500 x 500 px.
xs = x_spreadsheet(id, options)
// the parameters are:
id:the html node id ,for example :'#gridjs-demo' for the html <div id="gridjs-demo"></div>
options:the load options,
// the parameters for options:
updateMode: currently we only support 'server'
updateUrl: set the server side url for update action based on json
view: set the view size for the sheet,for example `{width: () => 1000, height: ()=> 500}`
mode: read means readonly spread sheet/edit means we can edit the spread sheet
allowSelectTextInTextBoxInReadMode: whether allow select text in TextBox control when in read mode,the default value is false
showToolbar: means whether to show toolbar
showFileName: whether to show the filename
local: support multiple language for menus ,the locale can be:
en, cn, es, pt, de, ru, nl,
for English,Chinese,Spanish,Portuguese,German,Russian,Dutch
ar, fr,id,it,ja
for Arabic,French,Indonesian,Italian,Japanese
ko,th,tr,vi,cht
for Korean,Thai,Turkey,Vietnamese,Traditional Chinese
showContextmenu: means whether to show contextmenu on right click on a cell
loadingGif: the loading gif url when loading the image/shape .it is optional,the default value is:content/img/updating.gif
for example the below code init a x_spreadsheet object.
xs = x_spreadsheet('#gridjs-demo', {
updateMode:'server',
updateUrl:'/GridJs2/UpdateCell',
mode: 'edit',
showToolbar: true,
local: 'en',
showContextmenu: true
})