Closed OlegKi closed 9 years ago
If people can pay for microsoft licence, he can pay someone to adapt grid to miscrosoft products...
The advantage of autodetection is to make the usage of grid simpler for users. The less you have ton config, the better.
"One have to know exact format or returned data to create the grid." Why ? The software can tell us... If someone need some specific things in the format, he can use xxxReader options.
What's the deal with loadcomplete ?
I think that every developer knows the data format that he use. So I don't see any problem with this. But I think that some of new users can think: "Why should I tell this stupid software what format it will use. Is it too stupid to see it itself? So why does it require one extra config line from me? And what will be if I just forget to add this config?". Maybe it's somethind like this: when I open, for example, a PDF file I know that it's PDF, but I can just click on it and "smart" computer opens it in associated application. I don't HAVE TO tell every time what to do with this file, but if I WANT I CAN do it.
Is this done?
See discussion here: https://github.com/openpsa/jsgrid/issues/46
It's the copy of some text from the post
The autodetection of
datatype
seems a good feature at the first point of view, but ... The first problem: There are some existing backend products which makes autodetection of the format based ondataType
used in the Ajax request. For example the WebServices of Microsoft (I mean .ASMX) return XML or JSON depend on it. I'm abrade that such systems will return XML in the case. It you would open the URL in web browser then you would see XML instead of JSON. So such autodetection could change the format returned from the server. jqGrid callbacks, custom formatters,cellattr
androwattr
just ptrovide the response as the parameter of the callback. So it makes break the existing code. The code ofloadComplete: function (data) { ... var rows = data.rows; ...}
will not more work becausedata.rows
will be wrong for XML response.Moreover, what is real use case of the usage of autodetection? One have to know exact format or returned data to create the grid. If one uses
repeatitems: false
format then thename
property (orjsonmap
) should exactly corresponds to the input data. To process XML response one have to write frequently another code. So if somebody useurl
parameter he have to know the format of data. He knows the type of returned data. So why one should not makedatatype
mandatory for the remote data? Why one should skip the option. So I don't understand the real case of the usage of autodetection of the format of the server response. I see more disadvantages in the implementation of the feature as advantages.