{"id":155,"date":"2022-07-22T08:28:52","date_gmt":"2022-07-22T00:28:52","guid":{"rendered":"http:\/\/axure.in\/?p=155"},"modified":"2023-04-25T13:35:34","modified_gmt":"2023-04-25T05:35:34","slug":"axure-advanced-tutorial-repeater-variable-columns","status":"publish","type":"post","link":"http:\/\/axure.in\/?p=155","title":{"rendered":"Axure Repeater Variable Columns"},"content":{"rendered":"\n<p><strong>Introduction<\/strong>&nbsp;:<\/p>\n\n\n\n<p>Repeater has become so common in Axure usage that many people are confused about not being able to change the number of columns too much.\u00a0for example:<\/p>\n\n\n\n<p>from 4 rows and 3 columns<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"http:\/\/axure.in\/wp-content\/uploads\/2022\/05\/image-7.png\" alt=\"\"\/><figcaption class=\"wp-element-caption\">4 rows and 3 columns<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Dynamically becomes 3 rows and 4 columns<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"http:\/\/axure.in\/wp-content\/uploads\/2022\/05\/image-8.png\" alt=\"\"\/><figcaption class=\"wp-element-caption\">3 rows and 4 columns<\/figcaption><\/figure>\n<\/div>\n\n\n<p>As of the current version, the official has not released the relevant settings, but we can do it by changing the coordinates.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"http:\/\/axure.in\/wp-content\/uploads\/2022\/05\/image-6.png\" alt=\"\"\/><figcaption class=\"wp-element-caption\">achieve the effect of changing here<\/figcaption><\/figure>\n<\/div>\n\n\n<p>The demo effect can be viewed at the link:&nbsp;<a href=\"https:\/\/5gn5xg.axshare.com\/#id=b8577g&amp;g=1\" data-type=\"URL\" data-id=\"https:\/\/5gn5xg.axshare.com\/#id=b8577g&amp;g=1\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/5gn5xg.axshare.com\/#id=b8577g&amp;g=1<\/a><\/p>\n\n\n\n<p><strong>Tutorial:<\/strong><\/p>\n\n\n\n<p>Below, I will teach you how to do it:<\/p>\n\n\n\n<p>First, we need a repeater, the layout is set to &#8220;Vertical&#8221;, and the &#8220;Grid distribution&#8221; is not selected (Wrap(Grid)):<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"http:\/\/axure.in\/wp-content\/uploads\/2022\/05\/image-3.png\" alt=\"\"\/><\/figure>\n<\/div>\n\n\n<p>In addition, a variable needs to be set. For the convenience of display, we use a global variable called columns. The default value is 3, indicating the initial number of columns:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"http:\/\/axure.in\/wp-content\/uploads\/2022\/05\/image-2.png\" alt=\"\"\/><\/figure>\n<\/div>\n\n\n<p>Double-click the repeater to enter the modification mode and create a new interaction event on the component.<\/p>\n\n\n\n<p>Note: is the &#8220;Loaded&#8221; of the component inside the repeater row, the event is move:<\/p>\n\n\n\n<p>The goal is: &#8220;To (To)&#8221;<\/p>\n\n\n\n<p>The x coordinate is: [[This.width*((Item.index-1)%columns)]]<\/p>\n\n\n\n<p>The y coordinate is: [[-This.Height*(Math.ceil(((Item.index-1)%columns)\/columns))]]<\/p>\n\n\n\n<p>If you want to see the animation effect, you can customize Animate, and it will be cool when you change it later.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"http:\/\/axure.in\/wp-content\/uploads\/2022\/05\/image-5.png\" alt=\"\"\/><\/figure>\n<\/div>\n\n\n<p>At this time, &#8220;Preview&#8221;, you can find that the effect of 4 rows and 3 columns we want has been completed.<\/p>\n\n\n\n<p>Next, we create a new button, the text of the button is &#8220;change to 4 columns&#8221;, and the new interaction &#8220;Click or Tap&#8221; has two steps:<\/p>\n\n\n\n<p>The first step is to &#8220;Set Variable Value&#8221; and select the &#8220;value&#8221; of the variable columns as 4.<\/p>\n\n\n\n<p>The second step is &#8220;Fire Event&#8221;, &#8220;Add Action&#8221;, the target is the &#8220;Loaded&#8221; event of the component in the repeater.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"http:\/\/axure.in\/wp-content\/uploads\/2022\/05\/image-4.png\" alt=\"\"\/><\/figure>\n<\/div>\n\n\n<p>Preview the page again, click the button &#8220;change to 4 columns&#8221;, you will find that the repeater has changed from 3 columns to 4 columns.<\/p>\n\n\n\n<p><strong>Summarize:<\/strong><\/p>\n\n\n\n<p>As long as the value of columns is changed first, and then the event of moving the coordinates is triggered, the number of columns can be dynamically changed.<\/p>\n\n\n\n<p>For more Axure tutorials, please visit:&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/axure-in.translate.goog\/?_x_tr_sl=zh-CN&amp;_x_tr_tl=en&amp;_x_tr_hl=zh-CN&amp;_x_tr_pto=wapp&amp;_x_tr_sch=http\" target=\"_blank\">http:\/\/axure.in\/<\/a>&nbsp;Here is the most Infation Axure data station.<\/p>\n<p>\u8f6c\u8f7d\u8bf7\u6ce8\u660e\uff1a<a href=\"http:\/\/axure.in\">\u6700In\u306eAxure<\/a> &raquo; <a href=\"http:\/\/axure.in\/?p=155\">Axure Repeater Variable Columns<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>Introduction&nbsp;: Repeater has become so common in Axure usage that many people are confused about not being able to change [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[35],"tags":[52,48,51],"class_list":["post-155","post","type-post","status-publish","format-standard","hentry","category-advanced-tutorial","tag-columns","tag-repeater","tag-variable"],"_links":{"self":[{"href":"http:\/\/axure.in\/index.php?rest_route=\/wp\/v2\/posts\/155","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/axure.in\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/axure.in\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/axure.in\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/axure.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=155"}],"version-history":[{"count":9,"href":"http:\/\/axure.in\/index.php?rest_route=\/wp\/v2\/posts\/155\/revisions"}],"predecessor-version":[{"id":10000013,"href":"http:\/\/axure.in\/index.php?rest_route=\/wp\/v2\/posts\/155\/revisions\/10000013"}],"wp:attachment":[{"href":"http:\/\/axure.in\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/axure.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=155"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/axure.in\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}