Closed lilyroselily closed 8 years ago
+1 and what's your environment?
hi @lilyroselily
Would you please attach the html of new issue page? I will check it.
Thanks
@archonwang thanks but may u give me the sample ,environment? my redmine is :bitnami-redmine-3.3.0-1-windows my explorer:IE or Edge anything else?
best regards
@onozaty thanks for reply soon but the GitHub doesn't support the html,css files to upload and notice just as "Unfortunately, we don’t support that file type. Try again with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. " so there are other ways to upload html and css files? best regards
@lilyroselily , you can get it on adminstration / information to get it.
@lilyroselily Please upload to compress the html into a zip file. Or changing the extension of the html file to .txt. I want to see the contents of the html file. css is not required.
@onozaty the html and css files ,please check thanks New issue - Redmine.txt application.css.txt jquery-ui-1.11.0.css.txt jstoolbar.css.txt responsive.css.txt
@archonwang hi,archonwang thanks for info my redmine environment as attachment file
@lilyroselily Thank you for the information.
I have one more question. Would you tell me the browser you are using?
@onozaty the browser that I use is Internet Explorer11 Version:11.589.10586.0 UpdateVersion:11.0.35(KB3185319) ProductID:00150-20000-00003-AA459 thanks a lot
@lilyroselily Sorry, this script not work in IE. In IE, will not be able to hide the option tag.
@onozaty
the explorer that the script can work, would u like teach?
thanks
@lilyroselily IE will not be able to hide the option tag. However, since can be disabled, please try the following.
$(function() {
var parentFieldId = 'issue_custom_field_values_1';
var childFieldId = 'issue_custom_field_values_2';
// 表示条件
var isTarget = function(child, parent) {
// 前方一致のものを対象に
return child.text().indexOf(parent.text()) == 0;
}
// 子フィールドの絞り込み
var narrowChildField = function() {
// 親で選択している項目
var parentSelected = $('#' + parentFieldId + ' > option:selected');
$('#' + childFieldId + ' > option').each(function() {
var child = $(this);
// 一致したものだけに絞り込む
// IEの場合はoptionがdisplay:noneで非表示にならないのでdisabledで
if (isTarget(child, parentSelected)) {
child.show();
child.prop('disabled', false);
} else {
child.hide();
child.prop('disabled', true);
}
});
}
// 現時点のもので子を絞り込み
narrowChildField();
// 親フィールドが変わった際に子フィールドを絞り込み
$('#all_attributes').change(function(e) {
if (e.target.id == parentFieldId) {
narrowChildField();
}
});
// ステータス変更時などにDOMが差し替えられるので
// フォームの内容が書き変わるたびに絞り込みを反映
var _replaceIssueFormWith = replaceIssueFormWith;
replaceIssueFormWith = function(html){
_replaceIssueFormWith(html);
narrowChildField();
};
});
Added "child.prop('disabled', false)" and "child.prop('disabled', false)". This code to disable the option.
@onozaty thanks a lot the above script , can work rightly in my IE, thanks once again best regards :)
@onozaty Where i can find the custom_field_id ? I try to use "3" and "4" from address:
"http://abc.com:3000/custom_fields/3/edit" "http://abc.com:3000/custom_fields/4/edit"
, but it's not work ! thanks !
try to get the custom field id from html source code.
@archonwang I got the id , thanks !
@onozaty , hi onozaty
firstly,thanks a lot for the script on http://blog.enjoyxstudy.com/entry/2016/04/03/000000. and i install the plugin:https://github.com/onozaty/redmine-view-customize successfully, then set the redmine as the comments of the plugin. but the plugin doesn't work .
there are some mistakes that i install and set process?
may u check the attacth file to tell me the mistakes that i made.
thanks so much
best wishes
The カスタムフィールドを連動させる(親の値に応じて、子を絞り込む) Plugin doesn't work.docx .