Categories | Question details Back To List | ||
Split on XML Hi, i have a grid of 21 columns that is loaded through xml but if i try to run the mygrid.splitAt(1); after the grid has loaded then it produces an error. is there a way that i can state in the xml document that i want it to split at 1 thanks Answer posted by Support on Nov 27, 2007 06:31 you can use afterInit section in XML <rows> <head> <afterInit> <call command="splitAt"><param>1</param></call> </afterInit> </head> <row id="1" ... normal data here ... Answer posted by Richard White on Nov 27, 2007 06:43 Hi Thanks for the quick response i have tested this and it works. i need to put a fake split in it as i had with the following code: mygrid.splitAt(1); mygrid.setColWidth(0,"1000px"); mygrid._fake._correctSplit(300px); do i apply do this when adding the first column and how will i do this thanks Answer posted by Support on Nov 27, 2007 09:45 The afterCall section can be used to call any method of grid, so basically you can set any mode from it ( the section may contain as many "call" tags as necessary ) Answer posted by Richard White on Nov 27, 2007 10:36 I appreciate your answer and it does make alot of sense. however i think you guys need to understand something: using this grid may be easy to you and although it is easy for the user your documentation is extremely limited i have tried to do another call on a command as: <call command="_fake._correctSplit"><param>300px</param></call> but this produces an error. unless i have the correct documentation or you tell me what i need to put then there is absolutely no way of me knowing this i think this is a vital point that you need to grasp, your documentation is extremely limited and it feels that because it is easy to you it is easy for everyone else, which is not the case you need to provide better documentation or help more with your answers please tell me how i do this thanks Answer posted by Richard White on Nov 27, 2007 10:43 I realise that you have now finished for the night, i have a deadline for tomorrow and now i am going to hand this in which this functionality not working - i feel a little let down as in your answer all you needed to do was to give me one line of code that tells me how to do this, but instead your response said that i should really know how to do this for myself! how am i supposed to work this out when your documentation doesn't tell me or you don't tell me? thanks Answer posted by Support on Nov 28, 2007 02:34 >>i have tried to do another call on a command as: >><call command="_fake._correctSplit"><param>300px</param></call> Actually the _fake._correctSplit is workaround proposed to achieve behavior necessary in your case, it never was purposed to public usage There is no easy way to call such functionality from XML ( becase it not direct method of grid ), it can be resolved by extending grid in next way grid = new .... grid.customFunction=function(val){ grid._fake._correctSplit(val); } and in XML <call command="customFunction"><param>300px</param></call> same approach can be used to add any other complex calls from XML Answer posted by Richard White on Dec 10, 2007 06:33 Hi This is not working, i have the following code attached to the grid: mygrid.customFunction=function(val) { mygrid._fake._correctSplit(val); } and then in the head section in the xml doc i have the following: <afterInit> <call command="splitAt"><param>1</param></call> <call command="customFunction"><param>1000px</param></call> </afterInit> please tell me what i am doing wrong thanks Answer posted by Support on Dec 10, 2007 10:13 My last example was not fully correct _correctSplit method avaits integer value as incoming param, providing it as string will not cause direct error, but will not be processed correctly ( it can process value with "px" as well, but it is based on used doctype settings, values as integer will work for any mode ) Please try to use <call command="customFunction"><param>1000</param></call> Answer posted by richard white on Dec 10, 2007 11:45 tried this but it is not resulting in the fake split as it did it before this actually changes the size of the column itself whereas we are obviously setting the column size to 300 width and want a fake split of 1000 so that they can scroll horizontally what is wrong? thanks Answer posted by Support on Dec 11, 2007 03:59 The original code was a mygrid.setColWidth(0,"1000px"); << change column width so, first column become a 1000px mygrid._fake._correctSplit(300); << move split zone so we have only 300px visible If you execute only second command, and the width of column will not be greater than split width - scroll will not be active. Sample sent by email. Answer posted by Richard on Dec 11, 2007 11:23 Hi, yes sorry my mistake, its working great now! i just have one more question in relation to this: we have 20 columns in a treegrid and the first column is the tree - this is where we want the split at 1000 and the fake split at 300 which is what we now have working. however we also want the 2nd column to be frozen so that it doesnt move when the user scrolls horizontally along the other 18 columns. is this possible? so essentially we think this is like having 2 splits, a split on the first column that has the fake split, but we also want the second column to be frozen as well. thanks Answer posted by Support on Dec 12, 2007 05:55 Unfortunately this is not possible, only one split area per grid is possible. Answer posted on Dec 12, 2007 07:52 so please help me with work around - need the tree column to obviously show all the data - not to have data going off the screen - and i need a split on column 2. please advice Answer posted by Support on Dec 12, 2007 10:10 This is one of the things, which really can't be implemented. Without global changes in grid structure, which will affect most functionality , there is no way to achieve such effect. The only thing which can be done, as far as I can see - two grids can be placed on same line, and onScroll events linked to sync current scroll state |