|
![]() |
#1 |
Участник
|
Сроки поджимали, поэтому пришлось сделать немного грубовато и не совсем так, как хотелось.
if (customerNotUser) { lookuptypeIcons = '/_imgs/ico_16_2.gif:/_imgs/ico_16_8.gif'; lookuptypenames = 'contact:2:Contact,systemuser:8:User'; lookuptypes = '2'; } else { lookuptypeIcons = '/_imgs/ico_16_8.gif:/_imgs/ico_16_2.gif'; lookuptypenames = 'systemuser:8:User,contact:2:Contact'; lookuptypes = '8'; } document.getElementById("requiredattendees").setAttribute("lookuptypes", lookuptypes); document.getElementById("requiredattendees").setAttribute("lookuptypenames", lookuptypenames); document.getElementById("requiredattendees").setAttribute("lookuptypeIcons", lookuptypeIcons); Xrm.Page.getControl("requiredattendees").addCustomView(contactViewId , 'contact', viewContactName, fetchContactXml , layoutContactXml, false); Xrm.Page.getControl("requiredattendees").addCustomView(userViewId, 'systemuser', viewUserName, fetchUserXml, layoutUserXml, false); if(customerNotUser) { document.getElementById("requiredattendees").setAttribute("defaulttype", 2); Xrm.Page.getControl("requiredattendees").setDefaultView(contactViewId ); } else { document.getElementById("requiredattendees").setAttribute("defaulttype", 8); Xrm.Page.getControl("requiredattendees").setDefaultView(userViewId); } Mscrm.Utilities.click(document.getElementById("requiredattendees")); //А здесь берем, и присваиваем заново значения заново, причем все и сразу lookuptypeIcons = '/_imgs/ico_16_2.gif:/_imgs/ico_16_8.gif'; lookuptypenames = 'contact:2:Contact,systemuser:8:User'; lookuptypes = '2,8'; document.getElementById("requiredattendees").setAttribute("lookuptypes", lookuptypes); document.getElementById("requiredattendees").setAttribute("lookuptypenames", lookuptypenames); document.getElementById("requiredattendees").setAttribute("lookuptypeIcons", lookuptypeIcons); Если будет время, попробую ваш код. Приведенный выше, конечно, не ахти. Можно ссылку, если не трудно, где можно подробно почитать о параметрах addCustomView ? |
|
![]() |
#2 |
Чайный пьяница
|
Посмотрите тут - http://msdn.microsoft.com/en-us/libr..._addCustomView
__________________
Эмо разработчик, сначала пишу код, потом плачу над его несовершенством. Подписывайтесь на мой блог, twitter и YouTube канал. Пользуйтесь моим Ultimate Workflow Toolkit |
|
|
Опции темы | Поиск в этой теме |
Опции просмотра | |
|