开发者

jqGrid dependable selects

开发者 https://www.devze.com 2023-02-09 00:10 出处:网络
I try to implement dependable selects. As example I took this resource My implementation is here 开发者_StackOverflow中文版The select lists could be found in \"Add new record\". What is wrong there?

I try to implement dependable selects. As example I took this resource

My implementation is here

开发者_StackOverflow中文版

The select lists could be found in "Add new record". What is wrong there?


If you look here (why you use '?' at the end of the url?) you will see

[]<option value="">Choose an option..</option><option value="md_assignment">Assignment</option><option value="md_camera">Camera</option><option value="md_film">Film</option><option value="md_film_condition">Film_condition</option><option value="md_filmformat">Filmformat</option><option value="md_filmtype">Filmtype</option><option value="md_framemaker">Framemaker</option><option value="md_lab">Lab</option><option value="md_lens">Lens</option><option value="md_owner">Owner</option><option value="md_paper">Paper</option><option value="md_scanner">Scanner</option>

The first [] characters cam make problems.

Moreover I don't understand why you need PHP session id to have the page and all HTTP GET URLs working.

UPDATED: I don't use PHP myself, so I can give you no advices why you has [] at the beginning of your server response, but it is empty JSON array. The corresponding response contain Content-Type: application/json in the HTML header and the code

$.get(getSelectFilterUrl, function(data) {
    var res = $(data).html();
    $('select#column').html(res);
});

try automatically interpret the data as JSON data. You receive an error and the 'success' function will not work. You can verify this if you replace $.get with $.ajax having success and error event handler. jqGrid use complete event handler instead of success and error. In the complete handle no data conversion will be made. It is why you have no problem with the first select.

The usage of $.ajax with complete event handler could be a workaround for you, but I strictly recommend you to examine your server code, remove Content-Type: application/json for the corresponding server response and fix the problem with [] characters.

0

精彩评论

暂无评论...
验证码 换一张
取 消